FormsAuthenticationUserCollection.Set Method (FormsAuthenticationUser)
.NET Framework (current version)
Modifies the specified FormsAuthenticationUser object contained in the collection.
Assembly: System.Web (in System.Web.dll)
Parameters
- user
-
Type:
System.Web.Configuration.FormsAuthenticationUser
The FormsAuthenticationUserCollection object that must be changed.
The following code example shows how to use the Set method.
// 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(); }
.NET Framework
Available since 2.0
Available since 2.0
Show: