IpcServerChannel.ChannelData プロパティ

定義

チャネル固有のデータを取得します。

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

プロパティ値

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 キャストできます。

適用対象