Bagikan melalui


WindowsAccountType Enum

Definisi

Menentukan tipe akun Windows yang digunakan.

public enum class WindowsAccountType
public enum WindowsAccountType
[System.Serializable]
public enum WindowsAccountType
[System.Serializable]
[System.Runtime.InteropServices.ComVisible(true)]
public enum WindowsAccountType
[System.Runtime.InteropServices.ComVisible(true)]
public enum WindowsAccountType
type WindowsAccountType = 
[<System.Serializable>]
type WindowsAccountType = 
[<System.Serializable>]
[<System.Runtime.InteropServices.ComVisible(true)>]
type WindowsAccountType = 
[<System.Runtime.InteropServices.ComVisible(true)>]
type WindowsAccountType = 
Public Enum WindowsAccountType
Warisan
WindowsAccountType
Atribut

Bidang

Anonymous 3

Akun anonim.

Guest 1

Akun tamu Windows.

Normal 0

Akun pengguna standar.

System 2

Akun sistem Windows.

Contoh

Contoh berikut menunjukkan cara menggunakan WindowsIdentity konstruktor untuk membuat instans WindowsIdentity baru kelas untuk pengguna yang diwakili oleh token akun Windows yang ditentukan, jenis autentikasi yang ditentukan, dan jenis akun Windows yang ditentukan. Contoh kode ini adalah bagian dari contoh yang lebih besar yang disediakan untuk WindowsIdentity kelas .

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

Keterangan

WindowsAccountType Enumerasi digunakan oleh WindowsIdentity kelas .

Berlaku untuk