HttpWebClientProtocol.Proxy プロパティ
定義
重要
一部の情報は、リリース前に大きく変更される可能性があるプレリリースされた製品に関するものです。 Microsoft は、ここに記載されている情報について、明示または黙示を問わず、一切保証しません。
ファイアウォールを介して 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 。 既定値は、オペレーティング システムのプロキシ設定です。
- 属性
例
次の例では、 Math XML Web サービスを呼び出す前に、プロキシ サーバーを http://proxyserver、プロキシ ポートを 80 に設定し、ローカル アドレスのプロキシ サーバーをバイパスするプロキシ設定を設定します。
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 プロパティを使用します。 IWebProxyを実装するため、WebProxy クラスを使用してプロキシ設定を設定します。
既定のプロキシ設定は、構成ファイルで設定できます。 詳細については、「 インターネット アプリケーションの構成」を参照してください。