简体   繁体   English

2 个 Windows 窗体应用程序之间的通信

[英]Communication between 2 Windows Forms applications

I have 2 windows form applications.我有 2 个 windows 窗体应用程序。 1st application interacts with database while the other application is aimed to communicate with the 1st application to interact with the database.第一个应用程序与数据库交互,而另一个应用程序旨在与第一个应用程序通信以与数据库交互。 So how can I interact two applications with each other.那么我如何才能使两个应用程序相互交互。 Which tool should I use?我应该使用哪种工具?

Here is a good example using WCF to communicate two processes:下面是一个使用 WCF 来通信两个进程的很好的例子:

http://www.switchonthecode.com/tutorials/wcf-tutorial-basic-interprocess-communication http://www.switchonthecode.com/tutorials/wcf-tutorial-basic-interprocess-communication

Another option is ZeroMQ C# binding:另一种选择是 ZeroMQ C# 绑定:

http://www.zeromq.org/bindings:clr http://www.zeromq.org/bindings:clr

One option would be to use WCF named pipes (net.pipe) the other option would be Anonymous Pipes for Local Interprocess Communication一种选择是使用 WCF 命名管道(net.pipe),另一种选择是用于本地进程间通信的匿名管道

Excerpt:摘抄:

Anonymous pipes offer less functionality than named pipes, but also require less overhead.匿名管道提供的功能比命名管道少,但也需要更少的开销。 You can use anonymous pipes to make interprocess communication on a local computer easier.您可以使用匿名管道使本地计算机上的进程间通信更容易。 You cannot use anonymous pipes for communication over a network.您不能使用匿名管道通过网络进行通信。

Use WCF with netnamedpipe binding as @I4V recommends.按照@I4V 的建议,将 WCF 与 netnamedpipe 绑定一起使用。 Other alternatives are use Pipes, Remoting, or fileshare.其他替代方法是使用管道、远程处理或文件共享。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM