当前位置:编程学习 > C#/ASP.NET >>

c#中得remoting

c#中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);
 }
} --------------------编程问答-------------------- 顶一楼 --------------------编程问答-------------------- 同意一楼的代码
补充:.NET技术 ,  C#
CopyRight © 2022 站长资源库 编程知识问答 zzzyk.com All Rights Reserved
部分文章来自网络,