AuthenticationLogonMethod 枚举
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
指定可用于建立安全虚拟目录登录会话的身份验证类型。
public enum class AuthenticationLogonMethod
public enum AuthenticationLogonMethod
type AuthenticationLogonMethod =
Public Enum AuthenticationLogonMethod
- 继承
-
AuthenticationLogonMethod
字段
Batch | 1 | 允许进程代表用户执行,而无需用户的直接干预。 用户必须具有用户权限才能作为批处理作业登录 (使用,例如,COM+ 应用程序) 。 此登录类型适用于登录性能非常重要的应用程序。 对 函数的基础调用 |
ClearText | 3 | 允许仅具有网络用户权限的用户使用明文凭据登录。 服务器可以接受用户凭据、调用 |
Interactive | 0 | 允许用户以交互方式与 Web 服务器登录。 对函数的基础调用 |
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 路径时,通常会使用这些登录模式。