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 實例,但這個屬性的值可以轉換成 ChannelDataStore 實例,描述物件所接聽的 IpcServerChannel 通道。