BasicHttpBinding.ProxyAddress Właściwość

Definicja

Pobiera lub ustawia adres URI serwera proxy 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

Wartość właściwości

Uri

Element Uri służący jako adres serwera proxy HTTP. Wartość domyślna to null.

Atrybuty

Przykłady

W poniższym przykładzie ustawiono wartość ProxyAddress na ustawienia aplikacji.

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

BasicHttpBinding binding = new BasicHttpBinding();

binding.ProxyAddress = baseAddress;

Wartość tej właściwości można również ustawić w pliku konfiguracji.

<configuration>
  <system.serviceModel>

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

  </system.serviceModel>

</configuration>

Uwagi

UseDefaultWebProxy Jeśli parametr ma wartość true, zostanie użyty adres domyślny, a wartość zestawu ProxyAddress zostanie zignorowana.

Dotyczy