WindowsAccountType 枚举

定义

指定使用的 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
继承
WindowsAccountType
属性

字段

Anonymous 3

匿名帐户。An anonymous account.

Guest 1

Windows 来宾帐户。A Windows guest account.

Normal 0

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

System 2

Windows 系统帐户。A Windows system account.

示例

下面的示例演示如何使用WindowsIdentity构造函数为指定的 windows 帐户标记、指定的身份验证类型和指定的 windows 帐户类型表示的用户创建WindowsIdentity类的新实例。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.

适用于