WindowsPrincipal.Identity 속성

정의

현재 보안 주체(principal)의 ID를 가져옵니다.

public:
 virtual property System::Security::Principal::IIdentity ^ Identity { System::Security::Principal::IIdentity ^ get(); };
public override System.Security.Principal.IIdentity Identity { get; }
public virtual System.Security.Principal.IIdentity Identity { get; }
member this.Identity : System.Security.Principal.IIdentity
Public Overrides ReadOnly Property Identity As IIdentity
Public Overridable ReadOnly Property Identity As IIdentity

속성 값

IIdentity

현재 보안 주체의 WindowsIdentity 개체입니다.

구현

예제

다음 예제에서는 개체의 속성을 사용하여 Identity 사용자의 이름을 검색합니다 WindowsPrincipal .

WindowsPrincipal^ wp = gcnew WindowsPrincipal( WindowsIdentity::GetCurrent() );
String^ username = wp->Identity->Name;
WindowsPrincipal wp = new WindowsPrincipal(WindowsIdentity.GetCurrent());
string username = wp.Identity.Name;
Dim wp As New WindowsPrincipal(WindowsIdentity.GetCurrent())
Dim username As String = wp.Identity.Name

적용 대상