TcpServerChannel.ChannelData 属性
定义
获取通道特定的数据。Gets channel-specific data.
public:
property System::Object ^ ChannelData { System::Object ^ get(); };
public object ChannelData { get; }
member this.ChannelData : obj
Public ReadOnly Property ChannelData As Object
属性值
包含信道特定数据的 ChannelDataStore 实例。A ChannelDataStore instance containing channel-specific data.
实现
示例
下面的代码示例演示如何使用此属性。The following code example shows the use of this property.
// Show the URIs associated with the channel.
ChannelDataStore^ data = dynamic_cast<ChannelDataStore^>(serverChannel->ChannelData);
System::Collections::IEnumerator^ myEnum = data->ChannelUris->GetEnumerator();
while ( myEnum->MoveNext() )
{
String^ uri = safe_cast<String^>(myEnum->Current);
Console::WriteLine( uri );
}
// Show the URIs associated with the channel.
ChannelDataStore data = (ChannelDataStore) serverChannel.ChannelData;
foreach (string uri in data.ChannelUris)
{
Console.WriteLine(uri);
}
注解
尽管作为的实例返回 System.Object ,但可以将此属性的值强制转换为 ChannelDataStore 说明对象所侦听的通道的实例 TcpServerChannel 。Although returned as an instance of System.Object, the value of this property can be cast to an instance of ChannelDataStore describing the channel to which the TcpServerChannel object listens.