HttpWebClientProtocol.Proxy Eigenschap

Definitie

Hiermee haalt u proxygegevens op voor het maken van een XML-webserviceaanvraag via een firewall.

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

Waarde van eigenschap

Een IWebProxy die de proxygegevens bevat voor het indienen van aanvragen via een firewall. De standaardwaarde is de proxy-instellingen van het besturingssysteem.

Kenmerken

Voorbeelden

In het volgende voorbeeld worden de volgende proxy-instellingen ingesteld voordat u de Math XML-webservice aanroept: de proxyserver naar http://proxyserver, de proxypoort naar 80 en de bypass naar de proxyserver voor 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)

Opmerkingen

Gebruik de Proxy eigenschap als een client andere proxy-instellingen moet gebruiken dan die in de systeeminstellingen. Gebruik de WebProxy klasse om de proxy-instellingen in te stellen, omdat deze wordt geïmplementeerd IWebProxy.

Standaardproxy-instellingen kunnen worden ingesteld in een configuratiebestand. Zie Internettoepassingen configureren voor meer informatie.

Van toepassing op

Zie ook