다음을 통해 공유


FormsAuthenticationUserCollection.Set(FormsAuthenticationUser) 메서드

정의

컬렉션 내의 지정된 FormsAuthenticationUser 개체를 수정합니다.

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)

매개 변수

user
FormsAuthenticationUser

변경해야 할 FormsAuthenticationUserCollection 개체입니다.

예제

다음 코드 예제에서는 Set 메서드를 사용하는 방법을 보여 줍니다.

// 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

적용 대상