FormsAuthenticationUserCollection.Set(FormsAuthenticationUser) Methode
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.
Ändert das angegebene FormsAuthenticationUser-Objekt in der Auflistung
public:
void Set(System::Web::Configuration::FormsAuthenticationUser ^ user);
public void Set (System.Web.Configuration.FormsAuthenticationUser user);
member this.Set : System.Web.Configuration.FormsAuthenticationUser -> unit
Public Sub Set (user As FormsAuthenticationUser)
Parameter
Das FormsAuthenticationUserCollection-Objekt, das geändert werden muss
Beispiele
Im folgenden Codebeispiel wird die Verwendung der Set-Methode veranschaulicht.
// Using method Set.
// Define the SHA1 encrypted password.
string newPassword =
"5BAA61E4C9B93F3F0682250B6CF8331B7EE68FD8";
// Define the user name.
string currentUserName = "userName";
// Create the new user.
FormsAuthenticationUser theUser =
new FormsAuthenticationUser(currentUserName, newPassword);
formsAuthenticationCredentials.Users.Set(theUser);
if (!authenticationSection.SectionInformation.IsLocked)
{
configuration.Save();
}
' Using method Set.
' Define the SHA1 encrypted password.
Dim newPassword As String = _
"5BAA61E4C9B93F3F0682250B6CF8331B7EE68FD8"
' Define the user name.
Dim currentUserName As String = "userName"
' Create the new user.
Dim theUser _
As New FormsAuthenticationUser(currentUserName, newPassword)
formsAuthenticationCredentials.Users.Set(theUser)
If Not authenticationSection.SectionInformation.IsLocked Then
configuration.Save()
End If
Gilt für:
Zusammenarbeit auf GitHub
Die Quelle für diesen Inhalt finden Sie auf GitHub, wo Sie auch Issues und Pull Requests erstellen und überprüfen können. Weitere Informationen finden Sie in unserem Leitfaden für Mitwirkende.