MachineKeySection.ValidationAlgorithm Propriedade

Definição

Obtém ou define o nome do algoritmo usado para validar a autenticação de formulários e exibir os dados de estado.Gets or sets the name of the algorithm that is used to validate forms authentication and view state data.

public:
 property System::String ^ ValidationAlgorithm { System::String ^ get(); void set(System::String ^ value); };
[System.ComponentModel.TypeConverter(typeof(System.Configuration.WhiteSpaceTrimStringConverter))]
[System.Configuration.ConfigurationProperty("validation", DefaultValue=Mono.Cecil.CustomAttributeArgument)]
[System.Configuration.StringValidator(MinLength=1)]
public string ValidationAlgorithm { get; set; }
[<System.ComponentModel.TypeConverter(typeof(System.Configuration.WhiteSpaceTrimStringConverter))>]
[<System.Configuration.ConfigurationProperty("validation", DefaultValue=Mono.Cecil.CustomAttributeArgument)>]
[<System.Configuration.StringValidator(MinLength=1)>]
member this.ValidationAlgorithm : string with get, set
Public Property ValidationAlgorithm As String

Valor da propriedade

String

Uma cadeia de caracteres que contém o nome de um algoritmo predefinido ou o nome de um algoritmo personalizado.A string that contains the name of a predefined algorithm or the name of a custom algorithm.

Atributos

Comentários

Os algoritmos predefinidos que estão disponíveis são definidos pela MachineKeyValidation enumeração.The predefined algorithms that are available are defined by the MachineKeyValidation enumeration. Se você quiser usar um algoritmo personalizado, não precisará definir essa propriedade.If you want to use a custom algorithm, you do not have to set this property. Defina a Validation propriedade como o nome do algoritmo personalizado.Set the Validation property to the name of the custom algorithm. Quando você fizer isso, essa propriedade será automaticamente definida como Custom .When you do that, this property will automatically be set to Custom.

Você pode definir a ValidationAlgorithm propriedade declarativamente no arquivo de Web.config ou programaticamente no código.You can set the ValidationAlgorithm property declaratively in the Web.config file or programmatically in code.

Para definir essa propriedade declarativamente, use o validationAlgorithm atributo do elemento machineKey no arquivo de configuração.To set this property declaratively, you use the validationAlgorithm attribute of the machineKey element in the configuration file. Esse atributo pode ser definido como o nome de um algoritmo predefinido ou de um algoritmo personalizado.This attribute can be set to the name of a predefined algorithm or of a custom algorithm. Os algoritmos predefinidos são definidos pela MachineKeyValidation enumeração.The predefined algorithms are defined by the MachineKeyValidation enumeration. Os algoritmos personalizados são especificados no validationAlgorithm atributo usando o prefixo "alg:" seguido pelo nome do algoritmo.Custom algorithms are specified in the validationAlgorithm attribute by using the "alg:" prefix followed by the name of the algorithm. Se você usar esse formato para especificar um algoritmo personalizado, a Validation propriedade será definida como Custom e essa propriedade será definida como o nome que segue o prefixo "alg:".If you use this format to specify a custom algorithm, the Validation property is set to Custom and this property is set to the name that follows the "alg:" prefix.

Para definir essa propriedade programaticamente, use o valor de um dos algoritmos predefinidos definidos pela MachineKeyValidation enumeração ou defina essa propriedade como um nome de algoritmo personalizado.To set this property programmatically, use the value of one of the predefined algorithms that are defined by the MachineKeyValidation enumeration, or set this property to a custom algorithm name. Se você definir essa propriedade como o nome de um algoritmo personalizado, defina a Validation propriedade como Custom .If you set this property to the name of a custom algorithm, set the Validation property to Custom.

Aplica-se a