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コンストラクターを使用して、指定した 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.

適用対象