WebProxy.GetDefaultProxy 方法
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
警告
WebProxy.GetDefaultProxy has been deprecated. Use the proxy selected for you by default.
警告
This method has been deprecated. Please use the proxy selected for you by default. https://go.microsoft.com/fwlink/?linkid=14202
警告
This method has been deprecated. Please use the proxy selected for you by default. http://go.microsoft.com/fwlink/?linkid=14202
讀取網路選項的非動態代理設定。
public:
static System::Net::WebProxy ^ GetDefaultProxy();
[System.Obsolete("WebProxy.GetDefaultProxy has been deprecated. Use the proxy selected for you by default.")]
public static System.Net.WebProxy GetDefaultProxy();
[System.Obsolete("This method has been deprecated. Please use the proxy selected for you by default. https://go.microsoft.com/fwlink/?linkid=14202")]
public static System.Net.WebProxy GetDefaultProxy();
[System.Obsolete("This method has been deprecated. Please use the proxy selected for you by default. http://go.microsoft.com/fwlink/?linkid=14202")]
public static System.Net.WebProxy GetDefaultProxy();
public static System.Net.WebProxy GetDefaultProxy();
[<System.Obsolete("WebProxy.GetDefaultProxy has been deprecated. Use the proxy selected for you by default.")>]
static member GetDefaultProxy : unit -> System.Net.WebProxy
[<System.Obsolete("This method has been deprecated. Please use the proxy selected for you by default. https://go.microsoft.com/fwlink/?linkid=14202")>]
static member GetDefaultProxy : unit -> System.Net.WebProxy
[<System.Obsolete("This method has been deprecated. Please use the proxy selected for you by default. http://go.microsoft.com/fwlink/?linkid=14202")>]
static member GetDefaultProxy : unit -> System.Net.WebProxy
static member GetDefaultProxy : unit -> System.Net.WebProxy
Public Shared Function GetDefaultProxy () As WebProxy
傳回
一個 WebProxy 包含網際網路選項中非動態代理設定的實例。
- 屬性
例外狀況
在 .NET Core 上。
備註
此 GetDefaultProxy 方法會從電腦的網際網路選項讀取非動態代理設定,並建立 WebProxy 包含這些設定的實例。
GetDefaultProxy 方法不會擷取由 Internet Explorer 執行的腳本、自動設定條目,或 DHCP 或 DNS 查詢所產生的任何動態設定。
應用程式應該使用 HttpClient.DefaultProxy 屬性而非方法 GetDefaultProxy 。
Note
此特性在 .NET Core 中不被支援。