BasicHttpBinding.ProxyAddress Vlastnost

Definice

Získá nebo nastaví adresu URI proxy serveru 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

Hodnota vlastnosti

Uri

A Uri , která slouží jako adresa proxy serveru HTTP. Výchozí hodnotou je hodnota null.

Atributy

Příklady

Následující příklad nastaví ProxyAddress na nastavení aplikace.

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

BasicHttpBinding binding = new BasicHttpBinding();

binding.ProxyAddress = baseAddress;

Hodnotu této vlastnosti lze také nastavit v konfiguračním souboru.

<configuration>
  <system.serviceModel>

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

  </system.serviceModel>

</configuration>

Poznámky

Pokud je nastavena UseDefaultWebProxy na true, použije se výchozí adresa a hodnota sady ProxyAddress se ignoruje.

Platí pro