共用方式為


authenticationModules 的 <新增>項目 (網路設定)

將驗證模組新增至應用程式。

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

Syntax

<add
  type="type_fullname, assembly_fullname"
/>  

屬性和項目

下列章節說明屬性、子元素和父元素。

屬性

Attribute 說明
type 完整型別名稱 (由 FullName 屬性所表示) 以及逗號分隔的組件名稱 (由 FullName 屬性所表示)。

子元素

無。

父項目

Element 說明
authenticationModules 指定用來驗證網路要求的模組。

備註

add 項目會將驗證模組加入至已註冊驗證模組清單的尾端。 驗證模組處理常式會依其加入至清單的順序進行呼叫。

type 屬性的值應該是有效的類型名稱和對應的元件名稱,並以逗號分隔。

組態檔

此項目可以用於應用程式組態檔或電腦組態檔 (Machine.config)。

範例

下列範例會啟用預設驗證模組。 您應該以指定模組的正確值取代 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>  

另請參閱