AuthenticationLogonMethod 列舉

定義

指定可用來建立安全虛擬目錄登入會話的驗證類型。

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

欄位

Batch 1

允許進程代表使用者執行,而不需要使用者的直接介入。 使用者必須具有使用者權限,才能以批次 (作業身分登入,例如 COM+ 應用程式) 。 此登入類型適用于登入效能非常重要的應用程式。 對函式的基礎呼叫 LogonUser 不會針對以 Batch 登入類型登入的使用者快取認證。

ClearText 3

允許只有網路使用者權限的使用者使用純文字認證登入。 伺服器可以接受使用者認證、呼叫 LogonUser 函式、確認使用者可以跨網路存取 Web 服務器,並且仍會使用預存的純文字認證與其他伺服器通訊。

Interactive 0

允許使用者以互動方式與網頁伺服器登入。 對函式的基礎呼叫 LogonUser 會快取已中斷連線作業的認證。

Network 2

允許使用者登入網路上的遠端伺服器。 此 AuthenticationLogonMethod 登入類型適用于高效能伺服器來驗證純文字密碼。 對函 LogonUser 式的基礎呼叫不會快取此登入類型的認證。

範例

下列範例會在預設網站下建立新的應用程式。 然後,此範例會設定應用程式的預設虛擬目錄,以使用批次驗證來登入 UNC 路徑。


using System;
using System.Collections.Generic;
using System.Text;
using Microsoft.Web.Administration;
using Microsoft.Web.Management;

namespace AdministrationSnippets
{
    public class AdministrationAuthenticationLogonMethod
    {
        // Creates a new virtual directory and sets the logon method.
        public void SetLogonMethod()
        {
            ServerManager manager = new ServerManager();
            Site defaultSite = manager.Sites["Default Web Site"];
            Application reports = defaultSite.Applications.Add(
                "/reports", @"\\FileServer\Reports");

            // Configure the default virtual directory for the application.
            VirtualDirectory reportDir = reports.VirtualDirectories[0];
            reportDir.LogonMethod = AuthenticationLogonMethod.Batch;
            reportDir.UserName = @"HumanResources\Jane";
            reportDir.Password = @"iL@1Fnw!";

            manager.CommitChanges();
        }
    }
}

備註

當虛擬目錄對應至 UNC 路徑時,您通常會使用這些登入模式。

適用於