HttpClientChannel Construtores

Definição

Inicializa uma nova instância da HttpClientChannel classe.

Sobrecargas

Name Description
HttpClientChannel()

Inicializa uma nova instância da HttpClientChannel classe.

HttpClientChannel(IDictionary, IClientChannelSinkProvider)

Inicializa uma nova instância da HttpClientChannel classe com as propriedades de configuração e o sink especificados.

HttpClientChannel(String, IClientChannelSinkProvider)

Inicializa uma nova instância da HttpClientChannel classe com o nome e o sumidouro especificados.

HttpClientChannel()

Inicializa uma nova instância da HttpClientChannel classe.

public:
 HttpClientChannel();
public HttpClientChannel();
Public Sub New ()

Observações

As propriedades de configuração da HttpClientChannel instância devolvida por este construtor estão todas definidas para os seus valores padrão.

Aplica-se a

HttpClientChannel(IDictionary, IClientChannelSinkProvider)

Inicializa uma nova instância da HttpClientChannel classe com as propriedades de configuração e o sink especificados.

public:
 HttpClientChannel(System::Collections::IDictionary ^ properties, System::Runtime::Remoting::Channels::IClientChannelSinkProvider ^ sinkProvider);
public HttpClientChannel(System.Collections.IDictionary properties, System.Runtime.Remoting.Channels.IClientChannelSinkProvider sinkProvider);
new System.Runtime.Remoting.Channels.Http.HttpClientChannel : System.Collections.IDictionary * System.Runtime.Remoting.Channels.IClientChannelSinkProvider -> System.Runtime.Remoting.Channels.Http.HttpClientChannel
Public Sub New (properties As IDictionary, sinkProvider As IClientChannelSinkProvider)

Parâmetros

properties
IDictionary

Uma IDictionary coleção que especifica valores para propriedades de configuração a serem usadas pelo canal.

sinkProvider
IClientChannelSinkProvider

A IClientChannelSinkProvider implementação a ser usada pelo canal.

Exceções

Uma propriedade de configuração estava formatada incorretamente.

Exemplos

O seguinte exemplo de código mostra como usar este construtor.

// Create a client channel.
System::Collections::Hashtable^ properties = gcnew System::Collections::Hashtable;
properties->default[ L"port" ] = 9090;
IClientChannelSinkProvider^ sinkProvider = nullptr;
HttpClientChannel^ clientChannel = gcnew HttpClientChannel( properties,sinkProvider );
// Create a client channel.
System.Collections.Hashtable properties =
    new System.Collections.Hashtable();
properties["port"] = 9090;
IClientChannelSinkProvider sinkProvider = null;
HttpClientChannel clientChannel = new HttpClientChannel(
    properties, sinkProvider);

Observações

Para mais informações sobre as propriedades de configuração do canal, consulte Propriedades de Configuração de Canal e Formator.

Se não precisar de funcionalidade de sink, defina o sinkProvider parâmetro para null.

Ver também

Aplica-se a

HttpClientChannel(String, IClientChannelSinkProvider)

Inicializa uma nova instância da HttpClientChannel classe com o nome e o sumidouro especificados.

public:
 HttpClientChannel(System::String ^ name, System::Runtime::Remoting::Channels::IClientChannelSinkProvider ^ sinkProvider);
public HttpClientChannel(string name, System.Runtime.Remoting.Channels.IClientChannelSinkProvider sinkProvider);
new System.Runtime.Remoting.Channels.Http.HttpClientChannel : string * System.Runtime.Remoting.Channels.IClientChannelSinkProvider -> System.Runtime.Remoting.Channels.Http.HttpClientChannel
Public Sub New (name As String, sinkProvider As IClientChannelSinkProvider)

Parâmetros

name
String

O nome da nova instância do HttpClientChannel.

sinkProvider
IClientChannelSinkProvider

A IClientChannelSinkProvider ser usada pelo canal.

Exemplos

O seguinte exemplo de código mostra como usar este construtor.

// Create a client channel.
String^ name = L"RemotingClient";
IClientChannelSinkProvider^ sinkProvider = nullptr;
HttpClientChannel^ clientChannel = gcnew HttpClientChannel( name,sinkProvider );
// Create a client channel.
string name = "RemotingClient";
IClientChannelSinkProvider sinkProvider = null;
HttpClientChannel clientChannel = new HttpClientChannel(name,
    sinkProvider);

Observações

Este construtor define a ChannelName propriedade usando o name parâmetro.

Aplica-se a