ChannelServices.UnregisterChannel(IChannel) 方法

定义

从注册信道列表中注销特定的信道。

public:
 static void UnregisterChannel(System::Runtime::Remoting::Channels::IChannel ^ chnl);
public static void UnregisterChannel (System.Runtime.Remoting.Channels.IChannel chnl);
static member UnregisterChannel : System.Runtime.Remoting.Channels.IChannel -> unit
Public Shared Sub UnregisterChannel (chnl As IChannel)

参数

chnl
IChannel

要注销的信道。

例外

chnl 参数为 null

未注册该信道。

在调用堆栈上部,至少有一个调用方没有配置远程处理类型和通道的权限。

示例

System::Console::WriteLine( "Hit <enter> to unregister the channels..." );
System::Console::ReadLine();

// Unregister the 'HttpChannel' and 'TcpChannel' channels.
ChannelServices::UnregisterChannel( myTcpChannel );
ChannelServices::UnregisterChannel( myHttpChannel );
Console::WriteLine( "Unregistered the channels." );
System.Console.WriteLine("Hit <enter> to unregister the channels...");
System.Console.ReadLine();
// Unregister the 'HttpChannel' and 'TcpChannel' channels.
ChannelServices.UnregisterChannel(myTcpChannel);
ChannelServices.UnregisterChannel(myHttpChannel);
Console.WriteLine("Unregistered the channels.");
System.Console.WriteLine("Hit <enter> to unregister the channels...")
System.Console.ReadLine()
' Unregister the 'HttpChannel' and 'TcpChannel' channels.
ChannelServices.UnregisterChannel(myTcpChannel)
ChannelServices.UnregisterChannel(myHttpChannel)
Console.WriteLine("Unregistered the channels.")

适用于