HttpWebClientProtocol.Proxy Eigenschaft

Definition

Ruft die Proxyinformationen zum Erstellen einer XML-Webdienstanforderung über einen Firewall ab oder legt sie fest.

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

Eigenschaftswert

IWebProxy

Ein IWebProxy mit den Proxyinformationen zum Ausführen einer Anforderung über eine Firewall. Die Proxyeinstellungen des Betriebssystems werden als Standardwert verwendet.

Attribute

Beispiele

Im folgenden Beispiel werden die folgenden Proxyeinstellungen vor dem Aufrufen des Math XML-Webdiensts festgelegt: der Proxyserver auf http://proxyserver, der Proxyport auf 80 und die Umgehung an den Proxyserver für lokale Adressen.

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)

Hinweise

Verwenden Sie die Proxy Eigenschaft, wenn ein Client unterschiedliche Proxyeinstellungen als die in den Systemeinstellungen verwenden muss. Verwenden Sie die WebProxy Klasse, um die Proxyeinstellungen festzulegen, da sie implementiert IWebProxywird.

Standardproxyeinstellungen können in einer Konfigurationsdatei festgelegt werden. Ausführliche Informationen finden Sie unter Konfigurieren von Internetanwendungen.

Gilt für

Siehe auch