ClientFormsAuthenticationCredentials(String, String, Boolean) 생성자

정의

ClientFormsAuthenticationCredentials 클래스의 새 인스턴스를 초기화합니다.

public:
 ClientFormsAuthenticationCredentials(System::String ^ username, System::String ^ password, bool rememberMe);
public ClientFormsAuthenticationCredentials(string username, string password, bool rememberMe);
new System.Web.ClientServices.Providers.ClientFormsAuthenticationCredentials : string * string * bool -> System.Web.ClientServices.Providers.ClientFormsAuthenticationCredentials
Public Sub New (username As String, password As String, rememberMe As Boolean)

매개 변수

username
String

사용자 이름입니다.

password
String

사용자 암호입니다.

rememberMe
Boolean

사용자 자격 증명을 저장하고 후속 로그인 시도에 다시 사용할지 여부를 나타내는 값입니다.

예제

다음 예제 코드는 이 클래스의 인스턴스를 IClientFormsAuthenticationCredentialsProvider.GetCredentials 반환하는 메서드를 구현하는 방법을 보여 줍니다. 이 예제에서 GetCredentials 메서드는 로그인 대화 상자 클래스의 일부입니다. 이 메서드는 대화 상자를 표시한 다음 사용자가 지정한 ClientFormsAuthenticationCredentials 값으로 초기화된 인스턴스를 반환합니다.

public ClientFormsAuthenticationCredentials GetCredentials()
{
    if (this.ShowDialog() == DialogResult.OK)
    {
        return new ClientFormsAuthenticationCredentials(
            usernameTextBox.Text, passwordTextBox.Text,
            rememberMeCheckBox.Checked);
    }
    else
    {
        return null;
    }
}
Public Function GetCredentials() As  _
    ClientFormsAuthenticationCredentials Implements _
    IClientFormsAuthenticationCredentialsProvider.GetCredentials

    If Me.ShowDialog() = DialogResult.OK Then
        Return New ClientFormsAuthenticationCredentials( _
            UsernameTextBox.Text, PasswordTextBox.Text, _
            rememberMeCheckBox.Checked)
    Else
        Return Nothing
    End If

End Function

설명

일반적으로 사용자가 제공한 값을 이 생성자의 매개 변수로 전달합니다.

적용 대상

추가 정보