WindowsAccountType Wyliczenie

Definicja

Określa typ używanego konta systemu Windows.

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
Dziedziczenie
WindowsAccountType
Atrybuty

Pola

Nazwa Wartość Opis
Anonymous 3

Konto anonimowe.

Guest 1

Konto gościa systemu Windows.

Normal 0

Konto użytkownika standardowego.

System 2

Konto systemowe systemu Windows.

Przykłady

W poniższym przykładzie pokazano, jak za pomocą WindowsIdentity konstruktora utworzyć nowe wystąpienie WindowsIdentity klasy dla użytkownika reprezentowanego przez określony token konta systemu Windows, określony typ uwierzytelniania i określony typ konta systemu Windows. Ten przykład kodu jest częścią większego przykładu podanego WindowsIdentity dla klasy.

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

Uwagi

Wyliczenie WindowsAccountType jest używane przez klasę WindowsIdentity .

Dotyczy

Produkt Wersje
.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