WindowsPrincipal Constructor (WindowsIdentity)

 

Initializes a new instance of the WindowsPrincipal class by using the specified WindowsIdentity object.

Namespace:   System.Security.Principal
Assembly:  mscorlib (in mscorlib.dll)

public WindowsPrincipal(
	WindowsIdentity ntIdentity
)

Parameters

ntIdentity
Type: System.Security.Principal.WindowsIdentity

The object from which to construct the new instance of WindowsPrincipal.

Exception Condition
ArgumentNullException

ntIdentity is null.

The following example creates a new WindowsPrincipal object from the current WindowsIdentity object.


WindowsIdentity wi = WindowsIdentity.GetCurrent();
WindowsPrincipal wp = new WindowsPrincipal(wi);

.NET Framework
Available since 1.1
Return to top
Show: