FormsAuthenticationUserCollection.Set(FormsAuthenticationUser) Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Modifies the specified FormsAuthenticationUser object contained in the collection.
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)
Parameters
The FormsAuthenticationUserCollection object that must be changed.
Examples
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();
}
' 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
Applies to
Colabore connosco no GitHub
A origem deste conteúdo pode ser encontrada no GitHub, onde também pode criar e rever problemas e pedidos Pull. Para mais informações, consulte o nosso guia do contribuidor.
Comentários
https://aka.ms/ContentUserFeedback.
Brevemente: Ao longo de 2024, vamos descontinuar progressivamente o GitHub Issues como mecanismo de feedback para conteúdos e substituí-lo por um novo sistema de feedback. Para obter mais informações, veja:Submeter e ver comentários