我为Dotnet狂

------学而不思则罔,思而不学则殆

 

Remoting的注册与注销

//获得当前已注册的通道;

IChannel[] channels = ChannelServices.RegisteredChannels;

 

//关闭指定名为MyTcp的通道;

foreach (IChannel eachChannel in channels)

{

 if (eachChannel.ChannelName == "MyTcp")

 {

  TcpChannel tcpChannel = (TcpChannel)eachChannel;

 

  //关闭监听;

  tcpChannel.StopListening(null);

 

  //注销通道;

  ChannelServices.UnregisterChannel(tcpChannel);

 }

}

posted on 2008-03-20 21:45  3stones  阅读(647)  评论(0)    收藏  举报

导航