BasicHttpBinding.ProxyAddress Properti

Definisi

Mendapatkan atau mengatur alamat URI proksi HTTP.

public:
 property Uri ^ ProxyAddress { Uri ^ get(); void set(Uri ^ value); };
public Uri ProxyAddress { get; set; }
[System.ComponentModel.TypeConverter(typeof(System.UriTypeConverter))]
public Uri ProxyAddress { get; set; }
member this.ProxyAddress : Uri with get, set
[<System.ComponentModel.TypeConverter(typeof(System.UriTypeConverter))>]
member this.ProxyAddress : Uri with get, set
Public Property ProxyAddress As Uri

Nilai Properti

Uri

Uri yang berfungsi sebagai alamat proksi HTTP. Nilai default-nya adalah null.

Atribut

Contoh

Contoh berikut mengatur ProxyAddress ke pengaturan aplikasi.

// Get base address from app settings in configuration
Uri baseAddress = new Uri(ConfigurationManager.AppSettings["baseAddress"]);

BasicHttpBinding binding = new BasicHttpBinding();

binding.ProxyAddress = baseAddress;

Nilai properti ini juga dapat diatur dalam file konfigurasi.

<configuration>
  <system.serviceModel>

    <bindings>
      <basicHttpBinding>
        <binding name="Binding1"
                 proxyAddress = "http://myProxy">
          <security mode="None" />
        </binding>
      </basicHttpBinding>
    </bindings>

  </system.serviceModel>

</configuration>

Keterangan

UseDefaultWebProxy Jika diatur ke true, alamat default digunakan dan nilai set ProxyAddress diabaikan.

Berlaku untuk