包含指定 .NET Framework 如何連接網路的設定。
<配置><system.net>
語法
<system.net>
</system.net>
屬性和項目
下列章節說明屬性、子元素和父元素。
Attributes
沒有。
子元素
| 元素 | 說明 |
|---|---|
| 認證模組 | 規範用於驗證網際網路請求的模組。 |
| 連線管理 | 指定與網際網路主機的最大連線數。 |
| defaultProxy | 配置超文本傳輸協定(HTTP)代理伺服器。 |
| 郵件設定 | 配置簡易郵件傳輸協定(SMTP)郵件發送選項。 |
| 請求快取 | 控制網路請求的快取機制。 |
| 設定 | 配置類別及相關子命名空間中的基本網路選項 System.Net 。 |
| webRequestModules | 指定用於向網際網路主機請求資訊的模組。 |
父項目
| 元素 | 說明 |
|---|---|
| 組態 | 包含所有命名空間的設定。 |
備註
<system.net> 元素包含了類別在子命名空間及相關命名空間中的設定System.Net。 設定中配置了驗證模組、連線管理、郵件設定、代理伺服器,以及用於從網際網路主機接收資訊的網際網路請求模組。
Example
以下範例展示了類別使用的 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>