WindowsIdentity.GetCurrent 메서드
정의
중요
일부 정보는 릴리스되기 전에 상당 부분 수정될 수 있는 시험판 제품과 관련이 있습니다. Microsoft는 여기에 제공된 정보에 대해 어떠한 명시적이거나 묵시적인 보증도 하지 않습니다.
현재 Windows 사용자를 나타내는 WindowsIdentity 개체를 반환합니다.
오버로드
| Name | Description |
|---|---|
| GetCurrent(TokenAccessLevels) |
지정한 원하는 토큰 액세스 수준을 사용하여 현재 Windows 사용자를 나타내는 WindowsIdentity 개체를 반환합니다. |
| GetCurrent(Boolean) |
WindowsIdentity 매개 변수의 값에 따라 스레드 또는 프로세스의 Windows ID를 나타내는 |
| GetCurrent() |
현재 Windows 사용자를 나타내는 WindowsIdentity 개체를 반환합니다. |
GetCurrent(TokenAccessLevels)
지정한 원하는 토큰 액세스 수준을 사용하여 현재 Windows 사용자를 나타내는 WindowsIdentity 개체를 반환합니다.
public:
static System::Security::Principal::WindowsIdentity ^ GetCurrent(System::Security::Principal::TokenAccessLevels desiredAccess);
public static System.Security.Principal.WindowsIdentity GetCurrent(System.Security.Principal.TokenAccessLevels desiredAccess);
static member GetCurrent : System.Security.Principal.TokenAccessLevels -> System.Security.Principal.WindowsIdentity
Public Shared Function GetCurrent (desiredAccess As TokenAccessLevels) As WindowsIdentity
매개 변수
- desiredAccess
- TokenAccessLevels
열거형 값의 비트 조합입니다.
반품
현재 사용자를 나타내는 개체입니다.
설명
매개 변수는 desiredAccess 액세스 토큰에 대한 요청된 액세스 유형을 식별하는 액세스 마스크를 지정합니다. 이러한 요청된 액세스 유형은 토큰의 DACL(임의 액세스 제어 목록)과 비교하여 어떤 유형의 액세스가 부여되거나 거부되는지 결정합니다.
적용 대상
GetCurrent(Boolean)
WindowsIdentity 매개 변수의 값에 따라 스레드 또는 프로세스의 Windows ID를 나타내는 ifImpersonating 개체를 반환합니다.
public:
static System::Security::Principal::WindowsIdentity ^ GetCurrent(bool ifImpersonating);
public static System.Security.Principal.WindowsIdentity? GetCurrent(bool ifImpersonating);
public static System.Security.Principal.WindowsIdentity GetCurrent(bool ifImpersonating);
static member GetCurrent : bool -> System.Security.Principal.WindowsIdentity
Public Shared Function GetCurrent (ifImpersonating As Boolean) As WindowsIdentity
매개 변수
- ifImpersonating
- Boolean
true스레드가 WindowsIdentity 현재 가장 중인 경우에만 반환하려면 이고, false 스레드가 가장하는 경우 스레드를 반환하거나 WindowsIdentity 스레드가 현재 가장하지 않는 경우 프로세스의 반환 WindowsIdentity 입니다.
반품
Windows 사용자를 나타내는 개체입니다.
설명
스레드 ifImpersonating 가 가장하지 않는 경우 true 반환 WindowsIdentity 된 개체에는 값이 없습니다. 스레드 ifImpersonating 가 가장하는 경우 false 스레드에 WindowsIdentity 대한 값이 반환됩니다. 스레드 ifImpersonating 가 가장하지 않는 경우 false 프로세스에 WindowsIdentity 대한 값이 반환됩니다.
적용 대상
GetCurrent()
현재 Windows 사용자를 나타내는 WindowsIdentity 개체를 반환합니다.
public:
static System::Security::Principal::WindowsIdentity ^ GetCurrent();
public static System.Security.Principal.WindowsIdentity GetCurrent();
static member GetCurrent : unit -> System.Security.Principal.WindowsIdentity
Public Shared Function GetCurrent () As WindowsIdentity
반품
현재 사용자를 나타내는 개체입니다.
예외
호출자에게 올바른 권한이 없습니다.
예제
다음 코드에서는 GetCurrent 메서드를 사용하여 현재 Windows 사용자를 나타내는 WindowsIdentity 개체를 반환하는 방법을 보여 줍니다. 이 코드 예제는 클래스에 제공된 더 큰 예제의 WindowsIdentity 일부입니다.
IntPtr accountToken = WindowsIdentity::GetCurrent()->Token;
IntPtr accountToken = WindowsIdentity.GetCurrent().Token;
Console.WriteLine( "Token number is: " + accountToken.ToString());
Dim accountToken As IntPtr = WindowsIdentity.GetCurrent().Token