WindowsAccountType Перечисление
Определение
Важно!
Некоторые сведения относятся к предварительной версии продукта, в которую до выпуска могут быть внесены существенные изменения. Майкрософт не предоставляет никаких гарантий, явных или подразумеваемых, относительно приведенных здесь сведений.
Задает тип используемой учетной записи Windows.
public enum class WindowsAccountType
[System.Runtime.InteropServices.ComVisible(true)]
public enum WindowsAccountType
public enum WindowsAccountType
[System.Serializable]
public enum WindowsAccountType
[System.Runtime.InteropServices.ComVisible(true)]
[System.Serializable]
public enum WindowsAccountType
[<System.Runtime.InteropServices.ComVisible(true)>]
type WindowsAccountType =
type WindowsAccountType =
[<System.Serializable>]
type WindowsAccountType =
[<System.Runtime.InteropServices.ComVisible(true)>]
[<System.Serializable>]
type WindowsAccountType =
Public Enum WindowsAccountType
- Наследование
- Атрибуты
Поля
Anonymous | 3 | Анонимная учетная запись. |
Guest | 1 | Учетная запись гостя Windows. |
Normal | 0 | Стандартная учетная запись пользователя. |
System | 2 | Системная учетная запись Windows. |
Примеры
В следующем примере показано, как использовать WindowsIdentity конструктор для создания нового экземпляра WindowsIdentity класса для пользователя, представленного указанным маркером учетной записи Windows, указанным типом проверки подлинности и указанным типом учетной записи Windows. Этот пример входит в состав более крупного примера использования класса WindowsIdentity.
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.
Применяется к
Обратная связь
https://aka.ms/ContentUserFeedback.
Ожидается в ближайшее время: в течение 2024 года мы постепенно откажемся от GitHub Issues как механизма обратной связи для контента и заменим его новой системой обратной связи. Дополнительные сведения см. в разделеОтправить и просмотреть отзыв по