共用方式為


WebProxy.Address 屬性

定義

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

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 執行個體,其中包含 Proxy 伺服器的位址。

範例

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

// The following method displays the properties of the 
// specified WebProxy instance.
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;
   }

   array<String^>^bypass = proxy->BypassList;
   Console::WriteLine( "The bypass list contents:" );
   for ( int i = 0; i < count; i++ )
   {
      Console::WriteLine( bypass[ i ] );

   }
}
// 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 包含 Proxy 伺服器的位址。 未啟用自動 Proxy 偵測,且未指定自動設定腳本時, Address 屬性和 BypassList 決定用於要求的 Proxy。

Address當 屬性為 null時,要求會略過 Proxy 並直接連線到目的地主機。

適用於