語言

IpcClientChannel 建構函式

定義

初始化 IpcServerChannel 類別的新執行個體。

多載

名稱 Description
IpcClientChannel()

初始化 IpcServerChannel 類別的新執行個體。

IpcClientChannel(IDictionary, IClientChannelSinkProvider)

初始化一個新的類別實例 IpcClientChannel ,並具備指定的組態屬性與 sink。

IpcClientChannel(String, IClientChannelSinkProvider)

初始化一個以指定名稱和 sink 的新 IpcClientChannel 類別實例。

IpcClientChannel()

初始化 IpcServerChannel 類別的新執行個體。

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

範例

以下程式碼範例說明如何使用此建構子。

IpcClientChannel^ clientChannel = gcnew IpcClientChannel;
ChannelServices::RegisterChannel( clientChannel );
IpcClientChannel clientChannel = new IpcClientChannel();
ChannelServices.RegisterChannel(clientChannel);

備註

這個建構子回傳的實例的設定屬性 TcpClientChannel 都設定為預設值。 下表顯示每個組態屬性的預設值。

配置屬性 Description
name 預設名稱是「ipc client」。 每個頻道必須有獨特的名稱。
priority 預設優先順序是 1。

適用於

IpcClientChannel(IDictionary, IClientChannelSinkProvider)

初始化一個新的類別實例 IpcClientChannel ,並具備指定的組態屬性與 sink。

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

參數

properties
IDictionary

一個 IDictionary 集合,指定通道將使用的配置屬性值。

sinkProvider
IClientChannelSinkProvider

IServerChannelSinkProvider頻道將使用的實作。

範例

以下程式碼範例說明如何使用此建構子。

// Create the client channel.
System::Collections::IDictionary^ properties = gcnew System::Collections::Hashtable;
properties->default[ L"name" ] = L"ipc client";
properties->default[ L"priority" ] = L"1";
IClientChannelSinkProvider^ sinkProvider = nullptr;
IpcClientChannel^ clientChannel = gcnew IpcClientChannel( properties,sinkProvider );
// Create the client channel.
System.Collections.IDictionary properties =
    new System.Collections.Hashtable();
properties["name"] = "ipc client";
properties["priority"] = "1";
System.Runtime.Remoting.Channels.IClientChannelSinkProvider
    sinkProvider = null;
IpcClientChannel clientChannel =
    new IpcClientChannel(properties, sinkProvider);

備註

欲了解更多通道配置屬性,請參閱 通道與形式配置屬性。

如果你不需要匯入功能,請將參數設 sinkProvider 為 null。

另請參閱

適用於

IpcClientChannel(String, IClientChannelSinkProvider)

初始化一個以指定名稱和 sink 的新 IpcClientChannel 類別實例。

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

參數

name
String

頻道的名稱。

sinkProvider
IClientChannelSinkProvider

IClientChannelSinkProvider頻道將使用的實作。

範例

以下程式碼範例說明如何使用此建構子。

// Create the client channel.
String^ name = L"ipc client";
IClientChannelSinkProvider^ sinkProvider = nullptr;
IpcClientChannel^ clientChannel = gcnew IpcClientChannel( name,sinkProvider );
// Create the client channel.
string name = "ipc client";
System.Runtime.Remoting.Channels.IClientChannelSinkProvider
    sinkProvider = null;
IpcClientChannel clientChannel =
    new IpcClientChannel(name, sinkProvider);

備註

此建構子透過參數ChannelName設定性質name。 如果你想註冊多個頻道,每個頻道必須有獨特的名稱。

如果你不需要匯入功能,請將參數設 sinkProvider 為 null。

適用於