WindowsAccountType Enumeration
Definition
Wichtig
Einige Informationen beziehen sich auf Vorabversionen, die vor dem Release ggf. grundlegend überarbeitet werden. Microsoft übernimmt hinsichtlich der hier bereitgestellten Informationen keine Gewährleistungen, seien sie ausdrücklich oder konkludent.
Gibt den Typ des verwendeten Windows-Kontos an.
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
- Vererbung
- Attribute
Felder
Anonymous | 3 | Ein anonymes Konto. |
Guest | 1 | Ein Windows-Gastkonto. |
Normal | 0 | Ein Standardbenutzerkonto. |
System | 2 | Ein Windows-Systemkonto. |
Beispiele
Das folgende Beispiel zeigt, wie Sie mithilfe des WindowsIdentity Konstruktors eine neue Instanz der WindowsIdentity -Klasse für den Benutzer erstellen, der durch das angegebene Windows-Kontotoken, den angegebenen Authentifizierungstyp und den angegebenen Windows-Kontotyp dargestellt wird. Dieses Codebeispiel ist Teil eines größeren Beispiels, das für die WindowsIdentity-Klasse bereitgestellt wird.
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
Hinweise
Die WindowsAccountType-Enumeration wird von der WindowsIdentity-Klasse verwendet.
Gilt für:
Feedback
https://aka.ms/ContentUserFeedback.
Bald verfügbar: Im Laufe des Jahres 2024 werden wir GitHub-Tickets als Feedbackmechanismus für Inhalte auslaufen lassen und es durch ein neues Feedbacksystem ersetzen. Weitere Informationen finden Sie unter:Einreichen und Feedback anzeigen für