WindowsIdentity Constructor (IntPtr)
Assembly: mscorlib (in mscorlib.dll)
The following table shows initial property values for an instance of WindowsIdentity.
| Property | Initial Value |
|---|---|
| NTLM | |
| Normal | |
| false |
Note |
|---|
| The token represented by userToken is usually retrieved through a call to unmanaged code, such as a call to the Win32 API LogonUser function. For more information on calls to unmanaged code, see Consuming Unmanaged DLL Functions. |
The following code example shows the use of the WindowsIdentity constructor to create a new instance of the WindowsIdentity class for the user represented by the current Windows account token. The WindowsIdentity object is used to get the security identifier for the token owner and the identity references for the groups the current user belongs to.
- SecurityPermission for the ability to manipulate the principal object. Associated enumeration: SecurityPermissionFlag.ControlPrincipal.
- SecurityPermission for the ability to access unmanaged code. Associated enumeration: SecurityPermissionFlag.UnmanagedCode.
Windows 2000 SP4, Windows Millennium Edition, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
The .NET Framework does not support all versions of every platform. For a list of the supported versions, see System Requirements.
Note