FormsAuthenticationUser.Password 属性
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
获取或设置用户密码。
public:
property System::String ^ Password { System::String ^ get(); void set(System::String ^ value); };
[System.Configuration.ConfigurationProperty("password", DefaultValue="", IsRequired=true)]
[System.Configuration.StringValidator]
public string Password { get; set; }
[<System.Configuration.ConfigurationProperty("password", DefaultValue="", IsRequired=true)>]
[<System.Configuration.StringValidator>]
member this.Password : string with get, set
Public Property Password As String
属性值
该应用程序需要的用户密码。
- 属性
示例
下面的代码示例说明如何使用 Password 属性。 请参阅类主题中的 FormsAuthenticationUser 代码示例,了解如何获取该部分。
// Using the Password property.
// Get current password.
string currentPassword =
formsAuthenticationUsers[0].Password;
// Set a SHA1 encrypted password.
// This example uses the SHA1 algorithm.
// Due to collision problems with SHA1, Microsoft recommends SHA256 or better.
formsAuthenticationUsers[0].Password =
"5BAA61E4C9B93F3F0682250B6CF8331B7EE68FD8";
' Using the Password property.
' Get current password.
Dim currentPassword As String = _
formsAuthenticationUsers(0).Password
' Set a SHA1 encrypted password.
' This example uses the SHA1 algorithm.
' Due to collision problems with SHA1, Microsoft recommends SHA256 or better.
formsAuthenticationUsers(0).Password = _
"5BAA61E4C9B93F3F0682250B6CF8331B7EE68FD8"