Lire en anglais

Partager via


WindowsAccountType Énumération

Définition

Spécifie le type de compte Windows utilisé.

C#
public enum WindowsAccountType
C#
[System.Serializable]
public enum WindowsAccountType
C#
[System.Serializable]
[System.Runtime.InteropServices.ComVisible(true)]
public enum WindowsAccountType
C#
[System.Runtime.InteropServices.ComVisible(true)]
public enum WindowsAccountType
Héritage
WindowsAccountType
Attributs

Champs

Nom Valeur Description
Anonymous 3

Compte anonyme.

Guest 1

Compte invité Windows.

Normal 0

Compte d'utilisateur standard.

System 2

Compte système Windows.

Exemples

L’exemple suivant montre comment utiliser le WindowsIdentity constructeur pour créer une instance de la classe pour l’utilisateur WindowsIdentity 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 .

C#
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 + ".");
}

Remarques

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

S’applique à

Produit Versions
.NET 6, 7, 8, 9
.NET Framework 1.1, 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
.NET Standard 2.0
Windows Desktop 3.0, 3.1, 5