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

允许用户以交互方式与 Web 服务器登录。 对函数的基础调用 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 路径时,通常会使用这些登录模式。

适用于