PasswordBox.Password 속성

정의

현재 PasswordBox에 들어 있는 암호를 가져오거나 설정합니다.

public:
 property System::String ^ Password { System::String ^ get(); void set(System::String ^ value); };
public string Password { [System.Security.SecurityCritical] get; [System.Security.SecurityCritical] set; }
public string Password { get; set; }
[<get: System.Security.SecurityCritical>]
[<set: System.Security.SecurityCritical>]
member this.Password : string with get, set
member this.Password : string with get, set
Public Property Password As String

속성 값

현재 PasswordBox에 들어 있는 암호를 나타내는 문자열입니다.

기본값은 Empty입니다.

특성

예제

다음 예제에서는 설정 하는 방법의 Password 속성 프로그래밍 방식으로 합니다.

PasswordBox pwdBox = new PasswordBox();
pwdBox.Password = "Open Sesame!";
Dim pwdBox As New PasswordBox()
pwdBox.Password = "Open Sesame!"

설명

속성 값을 받으면 Password 암호를 메모리의 일반 텍스트로 노출합니다. 이러한 잠재적인 보안 위험을 방지하려면 속성을 사용하여 SecurePassword 암호를 로 SecureString가져옵니다.

이 속성을 로 null 설정하면 기본 암호가 로 설정 Empty됩니다.

적용 대상

추가 정보