AuthenticationMode 列舉

定義

指定 Web 應用程式中使用的驗證模式。

public enum AuthenticationMode
繼承
AuthenticationMode

欄位

名稱 Description
Forms 3

將 ASP.NET 表單式驗證指定為驗證模式。

None 0

不指定驗證。

Passport 2

指定 Microsoft Passport 當做驗證模式。

Windows 1

指定 Windows 當做驗證模式。 當使用網際網路資訊服務 (IIS) 驗證方法 (基本、摘要、整合式 Windows (NTLM/Kerberos) 或憑證) 時,會套用這個模式。

範例

下列程式碼範例示範如何存取 Mode 屬性。

// 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, 4.8.1

另請參閱