FormsAuthenticationUser.Password Eigenschaft
Definition
Wichtig
Einige Informationen beziehen sich auf Vorabversionen, die vor dem Release ggf. grundlegend überarbeitet werden. Microsoft übernimmt hinsichtlich der hier bereitgestellten Informationen keine Gewährleistungen, seien sie ausdrücklich oder konkludent.
Ruft das Kennwort des Benutzers ab oder legt dieses fest.
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
Eigenschaftswert
Das für die Anwendung erforderliche Kennwort des Benutzers.
- Attribute
Beispiele
Im folgenden Codebeispiel wird die Verwendung der Password-Eigenschaft veranschaulicht. Weitere Informationen zum Abrufen des FormsAuthenticationUser Abschnitts finden Sie im Codebeispiel im Kursthema.
// 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"