IpcServerChannel.ChannelData 属性
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
获取通道特定的数据。
public:
property System::Object ^ ChannelData { System::Object ^ get(); };
public object ChannelData { get; }
member this.ChannelData : obj
Public ReadOnly Property ChannelData As Object
属性值
包含特定于信道的数据的 ChannelDataStore 实例。
实现
示例
下面的代码示例说明如何使用 ChannelData 属性。
// Show the URIs associated with the channel.
System::Runtime::Remoting::Channels::ChannelDataStore^ channelData =
static_cast<System::Runtime::Remoting::Channels::ChannelDataStore^>
(serverChannel->ChannelData);
System::Collections::IEnumerator^ myEnum = channelData->ChannelUris->GetEnumerator();
while ( myEnum->MoveNext() )
{
String^ uri = safe_cast<String^>( myEnum->Current );
Console::WriteLine( L"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实例返回,但此属性的值可以强制转换为描述对象侦听的通道的 IpcServerChannel 实例ChannelDataStore。