HttpWebClientProtocol.Proxy プロパティ

定義

ファイアウォールをとおして XML Web サービス要求を行うためのプロキシ情報を取得または設定します。

public:
 property System::Net::IWebProxy ^ Proxy { System::Net::IWebProxy ^ get(); void set(System::Net::IWebProxy ^ value); };
[System.ComponentModel.Browsable(false)]
public System.Net.IWebProxy Proxy { get; set; }
[<System.ComponentModel.Browsable(false)>]
member this.Proxy : System.Net.IWebProxy with get, set
Public Property Proxy As IWebProxy

プロパティ値

IWebProxy

ファイアウォールをとおして要求を行うためのプロキシ情報を格納している IWebProxy。 既定値は、オペレーティング システムのプロキシ設定値です。

属性

次の例では、XML Web サービスを呼び出す Math 前に、プロキシ サーバーを 80 に、プロキシ ポートを http://proxyserver80 に、ローカル アドレスをプロキシ サーバーにバイパスするプロキシ設定を設定します。

MyMath::Math^ math = gcnew MyMath::Math;

// Set the proxy server to proxyserver, set the port to 80, and specify to bypass the proxy server
// for local addresses.
IWebProxy^ proxyObject = gcnew WebProxy( "http://proxyserver:80",true );
math->Proxy = proxyObject;

// Call the Add XML Web service method.
int total = math->Add( 8, 5 );

MyMath.Math math = new MyMath.Math();

// Set the proxy server to proxyserver, set the port to 80, and specify to bypass the proxy server
// for local addresses.
IWebProxy proxyObject = new WebProxy("http://proxyserver:80", true);
math.Proxy = proxyObject;

// Call the Add XML Web service method.
int total = math.Add(8, 5);
Dim math As New MyMath.Math()

' Set the proxy server to proxyserver, set the port to 80, and specify
' to bypass the proxy server for local addresses.
Dim proxyObject As New WebProxy("http://proxyserver:80", True)
math.Proxy = proxyObject

' Call the Add XML Web service method.
Dim total As Integer = math.Add(8, 5)

注釈

クライアントが Proxy システム設定とは異なるプロキシ設定を使用する必要がある場合は、このプロパティを使用します。 WebProxy実装されているため、クラスを使用してプロキシ設定を設定しますIWebProxy

既定のプロキシ設定は、構成ファイルで設定できます。 詳細については、「 インターネット アプリケーションの構成」を参照してください。

適用対象

こちらもご覧ください