Redigeeri

Jagamisviis:


IpcServerChannel.ChannelData Property

Definition

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

Property Value

A ChannelDataStore instance that contains channel-specific data.

Implements

Examples

The following code example shows how to use the ChannelData property.

// 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);
}

Remarks

Although returned as an instance of the System.Object class, the value of this property can be cast to an instance of ChannelDataStore that describes the channel to which the IpcServerChannel object listens.

Applies to