WindowsAccountType WindowsAccountType WindowsAccountType WindowsAccountType Enum

定义

指定使用的 Windows 帐户的类型。Specifies the type of Windows account used.

public enum class WindowsAccountType
[System.Runtime.InteropServices.ComVisible(true)]
[System.Serializable]
public enum WindowsAccountType
type WindowsAccountType = 
Public Enum WindowsAccountType
继承
WindowsAccountTypeWindowsAccountTypeWindowsAccountTypeWindowsAccountType
属性

字段

Anonymous Anonymous Anonymous Anonymous 3

匿名帐户。An anonymous account.

Guest Guest Guest Guest 1

Windows 来宾帐户。A Windows guest account.

Normal Normal Normal Normal 0

标准用户帐户。A standard user account.

System System System System 2

Windows 系统帐户。A Windows system account.

示例

下面的示例演示如何使用WindowsIdentity构造函数创建的新实例WindowsIdentity类表示由指定的 Windows 帐户标记、 指定的身份验证类型和指定的 Windows 帐户类型的用户。The following example shows how to use the WindowsIdentity constructor to create a new instance of the WindowsIdentity class for the user represented by the specified Windows account token, the specified authentication type, and the specified Windows account type. 此代码示例是为提供一个更大示例的一部分WindowsIdentity类。This code example is part of a larger example provided for the WindowsIdentity class.

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

注解

WindowsAccountType 枚举由 WindowsIdentity 类使用。The WindowsAccountType enumeration is used by the WindowsIdentity class.

适用于