Export (0) Print
Expand All
0 out of 2 rated this helpful - Rate this topic

WindowsPrincipal.WindowsPrincipal Constructor

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
)
public WindowsPrincipal (
	WindowsIdentity ntIdentity
)
public function WindowsPrincipal (
	ntIdentity : WindowsIdentity
)
Not applicable.

Parameters

ntIdentity

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

Exception typeCondition

ArgumentNullException

ntIdentity is a null reference (Nothing in Visual Basic).

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


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


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

Windows Server 2000 SP4, Windows Millennium Edition, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.

.NET Framework

Supported in: 3.0, 2.0, 1.1, 1.0
Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback

Community Additions

ADD
Show:
© 2014 Microsoft. All rights reserved.