AuthenticationLogonMethod 列舉
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
指定可用來建立安全虛擬目錄登入會話的驗證類型。
public enum class AuthenticationLogonMethod
public enum AuthenticationLogonMethod
type AuthenticationLogonMethod =
Public Enum AuthenticationLogonMethod
- 繼承
-
AuthenticationLogonMethod
欄位
Batch | 1 | 允許進程代表使用者執行,而不需要使用者的直接介入。 使用者必須具有使用者權限,才能以批次 (作業身分登入,例如 COM+ 應用程式) 。 此登入類型適用于登入效能非常重要的應用程式。 對函式的基礎呼叫 |
ClearText | 3 | 允許只有網路使用者權限的使用者使用純文字認證登入。 伺服器可以接受使用者認證、呼叫 |
Interactive | 0 | 允許使用者以互動方式與網頁伺服器登入。 對函式的基礎呼叫 |
Network | 2 | 允許使用者登入網路上的遠端伺服器。 此 AuthenticationLogonMethod 登入類型適用于高效能伺服器來驗證純文字密碼。 對函 |
範例
下列範例會在預設網站下建立新的應用程式。 然後,此範例會設定應用程式的預設虛擬目錄,以使用批次驗證來登入 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 路徑時,您通常會使用這些登入模式。
適用於
意見反應
https://aka.ms/ContentUserFeedback。
即將登場:在 2024 年,我們將逐步淘汰 GitHub 問題作為內容的意見反應機制,並將它取代為新的意見反應系統。 如需詳細資訊,請參閱:提交並檢視相關的意見反應