FormsAuthenticationCredentials.PasswordFormat 属性
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
获取或设置密码格式。
public:
property System::Web::Configuration::FormsAuthPasswordFormat PasswordFormat { System::Web::Configuration::FormsAuthPasswordFormat get(); void set(System::Web::Configuration::FormsAuthPasswordFormat value); };
[System.Configuration.ConfigurationProperty("passwordFormat", DefaultValue=System.Web.Configuration.FormsAuthPasswordFormat.SHA1)]
public System.Web.Configuration.FormsAuthPasswordFormat PasswordFormat { get; set; }
[<System.Configuration.ConfigurationProperty("passwordFormat", DefaultValue=System.Web.Configuration.FormsAuthPasswordFormat.SHA1)>]
member this.PasswordFormat : System.Web.Configuration.FormsAuthPasswordFormat with get, set
Public Property PasswordFormat As FormsAuthPasswordFormat
属性值
- 属性
示例
下面的代码示例演示如何访问 PasswordFormat 属性。 请参阅类主题中的 FormsAuthenticationCredentials 代码示例,了解如何获取该部分。
// Get the current PasswordFormat property value.
FormsAuthPasswordFormat currentPasswordFormat =
formsAuthenticationCredentials.PasswordFormat;
// Set the PasswordFormat property value.
// This example uses the SHA1 algorithm.
// Due to collision problems with SHA1, Microsoft recommends SHA256 or better.
formsAuthenticationCredentials.PasswordFormat =
FormsAuthPasswordFormat.SHA1;
' Get the current PasswordFormat property value.
Dim currentPasswordFormat _
As FormsAuthPasswordFormat = _
formsAuthenticationCredentials.PasswordFormat
' Set the PasswordFormat property value.
' This example uses the SHA1 algorithm.
' Due to collision problems with SHA1, Microsoft recommends SHA256 or better.
formsAuthenticationCredentials.PasswordFormat = _
FormsAuthPasswordFormat.SHA1