Windows apps
Collapse the table of content
Expand the table of content
Information
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

ChannelServices::GetChannel Method (String^)

 

Returns a registered channel with the specified name.

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

public:
[SecurityCriticalAttribute]
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.

Exception Condition
SecurityException

The immediate caller does not have infrastructure permission.

HttpChannel^ myClientChannel = gcnew HttpChannel( myProperties,gcnew SoapClientFormatterSinkProvider,gcnew SoapServerFormatterSinkProvider );
ChannelServices::RegisterChannel( myClientChannel, false );

// Get the registered channel. 
Console::WriteLine( "Channel Name : {0}", ChannelServices::GetChannel( myClientChannel->ChannelName )->ChannelName );
Console::WriteLine( "Channel Priorty : {0}", ChannelServices::GetChannel( myClientChannel->ChannelName )->ChannelPriority );

SecurityPermission

For operating with infrastructure code. Demand value: SecurityAction::LinkDemand; Permission value: SecurityPermissionFlag::Infrastructure

.NET Framework
Available since 1.1
Return to top
Show:
© 2017 Microsoft