AuthenticationMode 列舉

定義

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

public enum class AuthenticationMode
public enum AuthenticationMode
type AuthenticationMode = 
Public Enum AuthenticationMode
繼承
AuthenticationMode

欄位

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;
' Get the current Mode property.
  Dim currentMode As AuthenticationMode = _
  authenticationSection.Mode

' Set the Mode property to Windows.
  authenticationSection.Mode = _
  AuthenticationMode.Windows

備註

Mode使用 屬性以程式設計方式設定 Web 應用程式所使用的驗證類型。

適用於

另請參閱