<defaultProxy> 項目

指定用於對網際網路之 HTTP 要求的 Proxy 伺服器。

<configuration>
<system.net>
<defaultProxy>

<defaultProxy>
</defaultProxy>

子項目

項目 說明
<proxy> 定義 Proxy 伺服器。
<bypasslist> 列出描述不使用 Proxy 之位址的規則運算式。
<module> 將新的 Pxory 模組加入至應用程式。

備註

<defaultProxy> 項目會定義 GlobalProxySelection 類別傳回的 Proxy 伺服器資訊。未設定 Proxy 屬性的任何 HttpWebRequest 都使用 defaultProxy 定義的 Proxy。

範例

以下範例會設定應用程式使用系統預設的 Proxy。

<configuration>
   <system.net>
      <defaultProxy>
         <proxy
            usesystemdefault = "true"
         />
      </defaultProxy>
   </system.net>
</configuration>

組態檔

這個項目可在應用程式組態檔、電腦組態檔 (Machine.config) 和發行者原則檔中使用。

請參閱

GlobalProxySelection | 網路設定結構描述