Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
GetChannel Method

ChannelServices.GetChannel Method

Returns a registered channel with the specified name.

Namespace:  System.Runtime.Remoting.Channels
Assembly:  mscorlib (in mscorlib.dll)

public static IChannel GetChannel(
	string name
)

Parameters

name
Type: System.String

The channel name.

Return Value

Type: System.Runtime.Remoting.Channels.IChannel
An interface to a registered channel, or null if the channel is not registered.

ExceptionCondition
SecurityException

The immediate caller does not have infrastructure permission.

HttpChannel myClientChannel = new HttpChannel(myProperties,
   new SoapClientFormatterSinkProvider(),
   new SoapServerFormatterSinkProvider());
ChannelServices.RegisterChannel(myClientChannel);
// Get the registered channel. 
Console.WriteLine("Channel Name : "+ChannelServices.GetChannel(
   myClientChannel.ChannelName).ChannelName);
Console.WriteLine("Channel Priorty : "+ChannelServices.GetChannel(
   myClientChannel.ChannelName).ChannelPriority);

.NET Framework

Supported in: 4.6, 4.5, 4, 3.5, 3.0, 2.0, 1.1

.NET Framework Client Profile

Supported in: 4, 3.5 SP1

Show:
© 2015 Microsoft