System.Security.Principal.WindowsIdentity.GetCurrent Method

Returns a System.Security.Principal.WindowsIdentity object that represents the current Windows user.

Syntax

public static WindowsIdentity GetCurrent ()

Returns

An object that represents the current user.

Remarks

C# Example

WindowsIdentity wi = WindowsIdentity.GetCurrent ();
Console.WriteLine ("\tUserName:\t{0}", wi.Name);
Console.WriteLine ("\tToken:\t\t{0}", wi.Token);
  

Requirements

Namespace: System.Security.Principal
Assembly: mscorlib (in mscorlib.dll)
Assembly Versions: 1.0.5000.0, 2.0.0.0, 4.0.0.0