<system.Net> 元素 (網路設定)

包含會指定 .NET Framework 如何連接至網路的設定。

<configuration>
  <system.net>

Syntax

<system.net>
</system.net>  

屬性和項目

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

屬性

無。

子元素

Element 說明
authenticationModules 指定用來驗證網際網路要求的模組。
connectionManagement 指定連線至網際網路主機的連線數目上限。
defaultProxy 設定超文字傳輸協定 (HTTP) 的 Proxy 伺服器。
mailSettings 設定簡易郵件傳輸通訊協定 (SMTP) 郵件傳送選項。
requestCaching 控制網路要求的快取機制。
設定 設定 System.Net 和相關子命名空間中類別的基本網路選項。
webRequestModules 指定要用來向網際網路主機要求資訊的模組。

父項目

Element 說明
設定 包含所有命名空間設定。

備註

<system.net> 元素包含 System.Net 和相關子命名空間中類別的設定。 這些設定可設定驗證模組、連線管理、郵件設定、Proxy 伺服器和網際網路要求模組,以接收來自網際網路主機的資訊。

範例

下列範例顯示 System.Net 類別所使用的一般設定。

<configuration>  
  <system.net>  
    <authenticationModules>  
      <add type="System.Net.DigestClient" />  
      <add type="System.Net.NegotiateClient" />  
      <add type="System.Net.KerberosClient" />  
      <add type="System.Net.NtlmClient" />  
      <add type="System.Net.BasicClient" />  
    </authenticationModules>  
    <connectionManagement>  
      <add address="*" maxconnection="2" />  
    </connectionManagement>  
    <defaultProxy>  
      <proxy  
        usesystemdefault="true"  
        bypassonlocal="true"  
      />  
    </defaultProxy>  
    <webRequestModules>  
      <add prefix="http"  
           type="System.Net.HttpRequestCreator"  
      />  
      <add prefix="https"  
           type="System.Net.HttpRequestCreator"  
      />  
      <add prefix="file"  
           type="System.Net.FileWebRequestCreator"  
      />  
    </webRequestModules>  
  </system.net>  
</configuration>  

另請參閱