HttpClientChannel Konstruktory

Definicja

Inicjuje nowe wystąpienie klasy HttpClientChannel.

Przeciążenia

HttpClientChannel()

Inicjuje nowe wystąpienie klasy HttpClientChannel.

HttpClientChannel(IDictionary, IClientChannelSinkProvider)

Inicjuje HttpClientChannel nowe wystąpienie klasy z określonymi właściwościami konfiguracji i ujściem.

HttpClientChannel(String, IClientChannelSinkProvider)

Inicjuje nowe wystąpienie klasy o określonej nazwie i ujściu HttpClientChannel .

HttpClientChannel()

Inicjuje nowe wystąpienie klasy HttpClientChannel.

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

Uwagi

Właściwości konfiguracji wystąpienia zwrócone HttpClientChannel przez ten konstruktor są ustawione na wartości domyślne.

Dotyczy

HttpClientChannel(IDictionary, IClientChannelSinkProvider)

Inicjuje HttpClientChannel nowe wystąpienie klasy z określonymi właściwościami konfiguracji i ujściem.

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)

Parametry

properties
IDictionary

IDictionary Kolekcja określająca wartości właściwości konfiguracji, które mają być używane przez kanał.

sinkProvider
IClientChannelSinkProvider

Implementacja IClientChannelSinkProvider do użycia przez kanał.

Wyjątki

Właściwość konfiguracji została niepoprawnie sformatowana.

Przykłady

W poniższym przykładzie kodu pokazano, jak używać tego konstruktora.

// 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);

Uwagi

Aby uzyskać więcej informacji na temat właściwości konfiguracji kanału, zobacz Właściwości konfiguracji kanału i formatnika.

Jeśli nie potrzebujesz funkcji ujścia sinkProvider , ustaw parametr na null.

Zobacz też

Dotyczy

HttpClientChannel(String, IClientChannelSinkProvider)

Inicjuje nowe wystąpienie klasy o określonej nazwie i ujściu HttpClientChannel .

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)

Parametry

name
String

Nazwa nowego wystąpienia klasy HttpClientChannel.

sinkProvider
IClientChannelSinkProvider

Element IClientChannelSinkProvider , który ma być używany przez kanał.

Przykłady

W poniższym przykładzie kodu pokazano, jak używać tego konstruktora.

// 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);

Uwagi

Ten konstruktor ustawia ChannelName właściwość przy użyciu parametru name .

Dotyczy