WindowsPrincipal(WindowsIdentity) Constructeur

Définition

Initialise une nouvelle instance de la classe WindowsPrincipal à l'aide de l'objet WindowsIdentity spécifié.

public:
 WindowsPrincipal(System::Security::Principal::WindowsIdentity ^ ntIdentity);
public WindowsPrincipal (System.Security.Principal.WindowsIdentity ntIdentity);
new System.Security.Principal.WindowsPrincipal : System.Security.Principal.WindowsIdentity -> System.Security.Principal.WindowsPrincipal
Public Sub New (ntIdentity As WindowsIdentity)

Paramètres

ntIdentity
WindowsIdentity

Objet à partir duquel la nouvelle instance de WindowsPrincipal doit être créée.

Exceptions

ntIdentity a la valeur null.

Exemples

L’exemple suivant crée un nouvel WindowsPrincipal objet à partir de l' WindowsIdentity objet actuel.

WindowsIdentity^ wi = WindowsIdentity::GetCurrent();
WindowsPrincipal^ wp = gcnew WindowsPrincipal( wi );

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

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

S’applique à