<system.net> 項目 (網路設定)

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

<system.net> 
</system.net>

屬性和項目

下列各節將說明屬性、子項目和父項目。

屬性

無。

子項目

項目

描述

<authenticationModules>

指定用於驗證網際網路要求的模組。

<connectionManagement>

指定連結至網際網路主機的最大數目。

<defaultProxy>

設定超文字傳輸協定 (HTTP) Proxy 伺服器。

<mailSettings>

設定 Simple Mail Transport Protocol (SMTP) 郵件傳送選項。

<requestCaching>

控制網路要求的快取機制。

<settings>

System.Net 和相關的子命名空間中的類別設定基本網路選項。

<webRequestModules>

指定向網際網路主機要求資訊所使用的模組。

父項目

項目

描述

<configuration>

包含所有命名空間的設定。

備註

<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>

請參閱

參考

網路設定結構描述