同一台机器上的进程间通信 [英] Inter process communication on same machine

查看:83
本文介绍了同一台机器上的进程间通信的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

using System;
using System.Diagnostics;
namespace csharp_station.howto
{
    /// <summary>
    /// Demonstrates how to start another program from C#
    /// </summary>
    class share
    {
        public int a;
        public int b;

    }
    class ProcessStart
    {
        static void Main(string[] args)
        {

            share share1 = new share();
            share1.a = 90;
            share1.b = 100;
            Process console36 = new Process();

            console36.StartInfo.FileName = @"e:\\ConsoleApplication36.exe";
            
            console36.Start();

        }

    }
    
}



现在,我想在ConsoleApplication35.exe中创建的ConsoleApplication36.exe中使用对象share1.
我该怎么做?请向我发送ConsoleApplication36.exe的代码.



Now i want to use object share1 in ConsoleApplication36.exe created in ConsoleApplication35.exe.
How can i do this ??Please send me code for ConsoleApplication36.exe..

推荐答案

您可以使用WCF和命名管道实现进程间通信:

使用WCF和NetNamedPipeBinding对多对一本地IPC [ ^ ]
You can implement interprocess communication using WCF and Named Pipes:

Many to One Local IPC using WCF and NetNamedPipeBinding[^]


这篇关于同一台机器上的进程间通信的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆