Namespace:
System.Security.Principal
Assembly:
mscorlib (in mscorlib.dll)
Visual Basic (Declaration)
Public Sub New ( _
ntIdentity As WindowsIdentity _
)
Dim ntIdentity As WindowsIdentity
Dim instance As New WindowsPrincipal(ntIdentity)
public WindowsPrincipal(
WindowsIdentity ntIdentity
)
public:
WindowsPrincipal(
WindowsIdentity^ ntIdentity
)
public function WindowsPrincipal(
ntIdentity : WindowsIdentity
)
| Exception | Condition |
|---|
| ArgumentNullException |
ntIdentity is nullNothingnullptra null reference (Nothing in Visual Basic). |
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)
WindowsIdentity wi = WindowsIdentity.GetCurrent();
WindowsPrincipal wp = new WindowsPrincipal(wi);
WindowsIdentity^ wi = WindowsIdentity::GetCurrent();
WindowsPrincipal^ wp = gcnew WindowsPrincipal( wi );
Windows 7, Windows Vista, Windows XP SP2, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP Starter Edition, Windows Server 2008 R2, Windows Server 2008, Windows Server 2003, Windows Server 2000 SP4, Windows Millennium Edition, Windows 98
The .NET Framework and .NET Compact Framework do not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.
.NET Framework
Supported in: 3.5, 3.0, 2.0, 1.1, 1.0
Reference