共用方式為


IpcChannel.ChannelData 屬性

定義

取得通道特定資料。

public:
 property System::Object ^ ChannelData { System::Object ^ get(); };
public object ChannelData { get; }
member this.ChannelData : obj
Public ReadOnly Property ChannelData As Object

屬性值

ChannelDataStore 執行個體,包含通道專用資料。

實作

範例

下列程式碼範例示範如何使用 ChannelData 屬性。 此程式代碼範例是針對 類別提供的較大範例的 IpcChannel 一部分。

// Show the URIs associated with the channel.
System::Runtime::Remoting::Channels::ChannelDataStore^ channelData = (System::Runtime::Remoting::Channels::ChannelDataStore^)serverChannel->ChannelData;
for each (String^ uri in channelData->ChannelUris)
{
   Console::WriteLine("The channel URI is {0}.", uri);
}
// Show the URIs associated with the channel.
System.Runtime.Remoting.Channels.ChannelDataStore channelData =
    (System.Runtime.Remoting.Channels.ChannelDataStore)
    serverChannel.ChannelData;
foreach (string uri in channelData.ChannelUris)
{
    Console.WriteLine("The channel URI is {0}.", uri);
}

備註

雖然 傳回做為 的System.Object實例,但這個屬性的值可以轉換成 描述物件接聽之通道的HttpServerChannel實例ChannelDataStore

適用於