WindowsAccountType Énumération

Définition

Spécifie le type de compte Windows utilisé.

public enum class WindowsAccountType
[System.Serializable]
public enum WindowsAccountType
[System.Serializable]
[System.Runtime.InteropServices.ComVisible(true)]
public enum WindowsAccountType
[<System.Serializable>]
type WindowsAccountType = 
[<System.Serializable>]
[<System.Runtime.InteropServices.ComVisible(true)>]
type WindowsAccountType = 
Public Enum WindowsAccountType
Héritage
WindowsAccountType
Attributs

Champs

Nom Valeur Description
Normal 0

Un compte d’utilisateur standard.

Guest 1

Un compte invité Windows.

System 2

Un compte système Windows.

Anonymous 3

Un compte anonyme.

Exemples

L’exemple suivant montre comment utiliser le constructeur WindowsIdentity pour créer une instance de la classe WindowsIdentity pour l’utilisateur représenté par le jeton de compte Windows spécifié, le type d’authentification spécifié et le type de compte Windows spécifié. Cet exemple de code fait partie d’un exemple plus grand fourni pour la WindowsIdentity classe.

void IntPtrStringTypeConstructor( IntPtr logonToken )
{
   
   // Construct a WindowsIdentity object using the input account token,
   // and the specified authentication type and Windows account type.
   String^ authenticationType = "WindowsAuthentication";
   WindowsAccountType guestAccount = WindowsAccountType::Guest;
   WindowsIdentity^ windowsIdentity = gcnew WindowsIdentity( logonToken,authenticationType,guestAccount );
   
   Console::WriteLine( "Created a Windows identity object named {0}.", windowsIdentity->Name );
}
private static void IntPtrStringTypeConstructor(IntPtr logonToken)
{
    // Construct a WindowsIdentity object using the input account token,
    // and the specified authentication type, and Windows account type.
    string authenticationType = "WindowsAuthentication";
    WindowsAccountType guestAccount = WindowsAccountType.Guest;
    WindowsIdentity windowsIdentity =
        new WindowsIdentity(logonToken, authenticationType, guestAccount);

    Console.WriteLine("Created a Windows identity object named " +
        windowsIdentity.Name + ".");
}
Private Sub IntPtrStringTypeConstructor(ByVal logonToken As IntPtr)
    ' Construct a WindowsIdentity object using the input account token,
    ' and the specified authentication type and Windows account type.
    Dim authenticationType As String = "WindowsAuthentication"
    Dim guestAccount As WindowsAccountType = WindowsAccountType.Guest
    Dim windowsIdentity As _
        New WindowsIdentity(logonToken, authenticationType, guestAccount)

    WriteLine("Created a Windows identity object named " + _
        windowsIdentity.Name + ".")
End Sub

Remarques

L’énumération WindowsAccountType est utilisée par la classe WindowsIdentity.

S’applique à