AuthenticationMode 枚举

定义

指定要在 Web 应用程序中使用的身份验证模式。

C#
public enum AuthenticationMode
继承
AuthenticationMode

字段

Forms 3

将基于 ASP.NET 窗体的身份验证指定为身份验证模式。

None 0

不指定身份验证。

Passport 2

将 Microsoft Passport 指定为身份验证模式。

Windows 1

将 Windows 指定为身份验证模式。 在使用 Internet 信息服务 (IIS) 身份验证方法(基本、简要、集成 Windows (NTLM/Kerberos) 或证书)时适用此模式。

示例

下面的代码示例演示如何访问 Mode 属性。

C#
// Get the current Mode property.
AuthenticationMode currentMode = 
    authenticationSection.Mode;

// Set the Mode property to Windows.
authenticationSection.Mode = 
    AuthenticationMode.Windows;

注解

Mode使用属性以编程方式配置 Web 应用程序使用的身份验证类型,

适用于

产品 版本
.NET Framework 1.1, 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8

另请参阅