共用方式為


WebProxy.Address 屬性

定義

取得或設定代理伺服器的位址。

public:
 property Uri ^ Address { Uri ^ get(); void set(Uri ^ value); };
public Uri? Address { get; set; }
public Uri Address { get; set; }
member this.Address : Uri with get, set
Public Property Address As Uri

屬性值

Uri

一個 Uri 包含代理伺服器位址的實例。

範例

以下程式碼範例顯示物件 WebProxy 的屬性,包括其 Address

// The following method displays the properties of the
// specified WebProxy instance.

public static void DisplayProxyProperties(WebProxy proxy)
{
    Console.WriteLine("Address: {0}", proxy.Address);
    Console.WriteLine( "Bypass on local: {0}", proxy.BypassProxyOnLocal );

    int count = proxy.BypassList.Length;
    if (count == 0)
    {
        Console.WriteLine("The bypass list is empty.");
        return;
    }
    string[] bypass = proxy.BypassList;
    Console.WriteLine("The bypass list contents:");

    for (int i=0; i< count; i++)
    {
        Console.WriteLine(bypass[i]);
    }
}

備註

Address 屬性包含代理伺服器的位址。 當未啟用自動代理偵測,且未指定自動設定腳本時, Address 屬性與 BypassList 決定用於請求的代理。

當屬性 Addressnull時,請求會繞過代理,直接連接到目的地主機。

適用於