Sdílet prostřednictvím


HttpClientChannel Konstruktory

Definice

Inicializuje novou instanci HttpClientChannel třídy.

Přetížení

Name Description
HttpClientChannel()

Inicializuje novou instanci HttpClientChannel třídy.

HttpClientChannel(IDictionary, IClientChannelSinkProvider)

Inicializuje novou instanci HttpClientChannel třídy se zadanými vlastnostmi konfigurace a jímkou.

HttpClientChannel(String, IClientChannelSinkProvider)

Inicializuje novou instanci HttpClientChannel třídy se zadaným názvem a jímkou.

HttpClientChannel()

Inicializuje novou instanci HttpClientChannel třídy.

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

Poznámky

Vlastnosti HttpClientChannel konfigurace instance vrácené tímto konstruktorem jsou všechny nastaveny na jejich výchozí hodnoty.

Platí pro

HttpClientChannel(IDictionary, IClientChannelSinkProvider)

Inicializuje novou instanci HttpClientChannel třídy se zadanými vlastnostmi konfigurace a jímkou.

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

Kolekce IDictionary , která určuje hodnoty vlastností konfigurace, které má kanál používat.

sinkProvider
IClientChannelSinkProvider

Implementace IClientChannelSinkProvider , kterou má kanál používat.

Výjimky

Vlastnost konfigurace byla nesprávně naformátována.

Příklady

Následující příklad kódu ukazuje, jak použít tento konstruktor.

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

Poznámky

Další informace o vlastnostech konfigurace kanálu naleznete v tématu Channel and Formatter Configuration Properties.

Pokud nevyžadujete funkčnost jímky, nastavte sinkProvider parametr na nullhodnotu .

Viz také

Platí pro

HttpClientChannel(String, IClientChannelSinkProvider)

Inicializuje novou instanci HttpClientChannel třídy se zadaným názvem a jímkou.

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

Název nové instance HttpClientChannel.

sinkProvider
IClientChannelSinkProvider

To IClientChannelSinkProvider , co má kanál používat.

Příklady

Následující příklad kódu ukazuje, jak použít tento konstruktor.

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

Poznámky

Tento konstruktor nastaví ChannelName vlastnost pomocí parametru name .

Platí pro