Szerkesztés

Megosztás a következőn keresztül:


MachineKeySection.Validation Property

Definition

Specifies the hashing algorithm that is used for validating forms authentication and view state data.

public:
 property System::Web::Configuration::MachineKeyValidation Validation { System::Web::Configuration::MachineKeyValidation get(); void set(System::Web::Configuration::MachineKeyValidation value); };
[System.ComponentModel.TypeConverter(typeof(System.Web.Configuration.MachineKeyValidationConverter))]
[System.Configuration.ConfigurationProperty("validation", DefaultValue=System.Web.Configuration.MachineKeyValidation.SHA1)]
public System.Web.Configuration.MachineKeyValidation Validation { get; set; }
public System.Web.Configuration.MachineKeyValidation Validation { get; set; }
[<System.ComponentModel.TypeConverter(typeof(System.Web.Configuration.MachineKeyValidationConverter))>]
[<System.Configuration.ConfigurationProperty("validation", DefaultValue=System.Web.Configuration.MachineKeyValidation.SHA1)>]
member this.Validation : System.Web.Configuration.MachineKeyValidation with get, set
member this.Validation : System.Web.Configuration.MachineKeyValidation with get, set
Public Property Validation As MachineKeyValidation

Property Value

A value that indicates the hashing algorithm that is used to validate forms authentication and view state data.

Attributes

Examples

The following example demonstrates how to set the Validation property by using code. This example is part of a larger example provided for the MachineKeySection class.

// Display Validation property.
Console.WriteLine("Validation: {0}",
  configSection.Validation);
' Display Validation value.
Console.WriteLine("Validation: {0}", configSection.Validation)

Remarks

The Validation property supports encryption algorithms that are defined by the MachineKeyValidation enumeration. This property is typically set declaratively in the decryption attribute of the machineKey element of the Web.config file. For more information, see the machineKey element.

Applies to

See also