WindowsPrincipal Constructor
Collapse the table of content
Expand the table of content

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


Type: System.Security.Principal.WindowsIdentity

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

Exception Condition

ntIdentity is null.

Legacy Code Example

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
© 2015 Microsoft