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 Sub New (
	ntIdentity As WindowsIdentity
)

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.


Dim wi As WindowsIdentity = WindowsIdentity.GetCurrent()
Dim wp As New WindowsPrincipal(wi)        

.NET Framework
Available since 1.1
Return to top
Show: