进程之间的C#通信 [英] C# communication between processes
问题描述
我与一个应用程序的工作,我能够让C#脚本,在这种环境中运行。我可以导入任何类型的DLL文件到这个环境。我的问题是我想启用这些脚本之间的通信。随着环境的控制和我有应用程序的源代码不能访问,我在一个不知如何做到这一点。
I'm working with an application, and I am able to make C# scripts to run in this environment. I can import DLLs of any kind into this environment. My problem is that I'd like to enable communication between these scripts. As the environment is controlled and I have no access to the source code of the application, I'm at a loss as to how to do this.
事情我已经尝试:
-
文件I / O:只是写,我想每一个.txt文件读取消息,并具有其他阅读。问题是,我需要这个脚本相当快速地运行,并且花了太多时间
File I/O: Just writing the messages that I would like each to read in .txt files and having the other read it. Problem is that I need this scripts to run quite quickly and that took up too much time.
的 nServiceBus :我想这一点,但我不能让它在我处理的环境中工作。我不是说不能做,只是我无法完成它。
nServiceBus: I tried this, but I just couldn't get it to work in the environment that I'm dealing with. I'm not saying it can't be done, just that I can't get it done.
有谁知道一个简单的方法来做到这一点,这也是蛮快的?
Does anyone know of a simple way to do this, that is also pretty fast?
推荐答案
答案简单;
既然你可以导入任何DLL到脚本中,你可以创建一个自定义DLL,将实现你的愿望任何方式进程之间的通信:共享内存,命名管道,TCP / UDP。
Since you can import any DLL into the script you may create a custom DLL that will implement communication between the processes in any way you desire: shared memory, named pipe, TCP/UDP.
这篇关于进程之间的C#通信的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!