ChannelServices.GetChannel(String) ChannelServices.GetChannel(String) ChannelServices.GetChannel(String) ChannelServices.GetChannel(String) Method

Definizione

Restituisce un canale registrato con il nome specificato.Returns a registered channel with the specified name.

public:
 static System::Runtime::Remoting::Channels::IChannel ^ GetChannel(System::String ^ name);
[System.Security.SecurityCritical]
public static System.Runtime.Remoting.Channels.IChannel GetChannel (string name);
static member GetChannel : string -> System.Runtime.Remoting.Channels.IChannel
Public Shared Function GetChannel (name As String) As IChannel

Parametri

name
String String String String

Nome del canale.The channel name.

Restituisce

Interfaccia a un canale registrato o null se il canale non è registrato.An interface to a registered channel, or null if the channel is not registered.

Eccezioni

Il chiamante immediato non dispone dell'autorizzazione di infrastruttura.The immediate caller does not have infrastructure permission.

Esempi

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

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);
Dim myClientChannel As 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.ToString())

Sicurezza

SecurityPermission
per l'utilizzo del codice dell'infrastruttura.For operating with infrastructure code. Valore richiesta: LinkDemand; Valore autorizzazione:InfrastructureDemand value: LinkDemand; Permission value: Infrastructure

Si applica a