<add> authenticationModules 的元素(网络设置)

将身份验证模块添加到应用程序。

<configuration>
  <system.net>
    <authenticationModules>
      <add>

Syntax

<add
  type="type_fullname, assembly_fullname"
/>

特性和元素

下列各节描述了特性、子元素和父元素。

特性

属性 说明
type 完全限定的类型名称(由 FullName 属性指示)和程序集名称(由 FullName 属性指示),用逗号分隔。

子元素

没有。

父元素

元素 说明
authenticationModules 指定用于对网络请求进行身份验证的模块。

注解

该 add 元素将身份验证模块添加到已注册的身份验证模块列表的末尾。 身份验证模块按添加到列表的顺序调用。

特性的值 type 应该是有效的类型名称和相应的程序集名称,用逗号分隔。

配置文件

此元素可用于应用程序配置文件或计算机配置文件(Machine.config)。

Example

以下示例启用默认身份验证模块。 应将 Version 和 PublicKeyToken 的值替换为指定模块的正确值。

<configuration>
  <system.net>
        <authenticationModules>
            <add type="System.Net.DigestClient, System, Version=2.0.3600.0,
                 Culture=neutral, PublicKeyToken=b77a5c561934e089" />
            <add type="System.Net.NegotiateClient, System, Version=2.0.3600.0,
                 Culture=neutral, PublicKeyToken=b77a5c561934e089" />
            <add type="System.Net.KerberosClient, System, Version=2.0.3600.0,
                 Culture=neutral, PublicKeyToken=b77a5c561934e089" />
            <add type="System.Net.NtlmClient, System, Version=2.0.3600.0,
                 Culture=neutral, PublicKeyToken=b77a5c561934e089" />
            <add type="System.Net.BasicClient, System, Version=2.0.3600.0,
                 Culture=neutral, PublicKeyToken=b77a5c561934e089" />
        </authenticationModules>
  </system.net>
</configuration>

另请参阅