Share via


BasicHttpBinding.ProxyAddress Propriedade

Definição

Obtém ou define o endereço do URI do 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

Valor da propriedade

Uri

Um Uri que serve como o endereço do proxy HTTP. O valor padrão é nulo.

Atributos

Exemplos

O exemplo a seguir define ProxyAddress como configurações de aplicativo.

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

BasicHttpBinding binding = new BasicHttpBinding();

binding.ProxyAddress = baseAddress;

O valor dessa propriedade também pode ser definido no arquivo de configuração.

<configuration>
  <system.serviceModel>

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

  </system.serviceModel>

</configuration>

Comentários

Se o UseDefaultWebProxy estiver definido como true, o endereço padrão será usado e o valor do conjunto ProxyAddress será ignorado.

Aplica-se a