zoukankan      html  css  js  c++  java
  • C# IPC信道跨进程通信

    Server端:注册信道

    1 /// <summary>
    2         /// 注册IPC管道通讯
    3         /// </summary>
    4         public void IpcServer()
    5         {
    6             IpcServerChannel channel = new IpcServerChannel("ServerChannel");
    7             ChannelServices.RegisterChannel(channel, false);
    8             RemotingConfiguration.RegisterWellKnownServiceType(typeof(类型-class), "注册名称--对象名", WellKnownObjectMode.SingleCall);
    9         }
    View Code

    Client端:连接获取信道

    1 IpcClientChannel channel = new IpcClientChannel();
    2                 ChannelServices.RegisterChannel(channel, false);
    3 
    4                 (类型-class) obj = (类型-class)Activator.GetObject(typeof(类型-class), "ipc://ServerChannel/注册信道名-对象名");
    5 
    6                 
    View Code
  • 相关阅读:
    Yarn
    easyui
    eclipse-android
    js-小技能 そうですか
    sql server 时间处理
    上传文件
    时间 & 时间戳 之间 转换
    JDIC
    Spring 定时器
    映射
  • 原文地址:https://www.cnblogs.com/BennyHua/p/11133414.html
Copyright © 2011-2022 走看看