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

适用于