HttpWebClientProtocol.Proxy Properti
Definisi
Penting
Beberapa informasi terkait produk prarilis yang dapat diubah secara signifikan sebelum dirilis. Microsoft tidak memberikan jaminan, tersirat maupun tersurat, sehubungan dengan informasi yang diberikan di sini.
Mendapatkan atau mengatur informasi proksi untuk membuat permintaan layanan Web XML melalui 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
Nilai Properti
Yang IWebProxy berisi informasi proksi untuk membuat permintaan melalui firewall. Nilai defaultnya adalah pengaturan proksi sistem operasi.
- Atribut
Contoh
Contoh berikut mengatur pengaturan proksi berikut sebelum memanggil Math layanan Web XML: server proksi ke http://proxyserver, port proksi ke 80 dan bypass ke server proksi untuk alamat lokal.
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)
Keterangan
Proxy Gunakan properti jika klien perlu menggunakan pengaturan proksi yang berbeda dari yang ada di pengaturan sistem. WebProxy Gunakan kelas untuk mengatur pengaturan proksi, karena menerapkan IWebProxy.
Pengaturan proksi default dapat diatur dalam file konfigurasi. Untuk detailnya, lihat Mengonfigurasi Aplikasi Internet.