C#应用程序之间的通信 - 轻松的途径 [英] Communication between C# applications - the easy way

查看:103
本文介绍了C#应用程序之间的通信 - 轻松的途径的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有两个C#程序,我想发送一些数据来回它们之间。 (并检查是否到达的数据到其他应用程序。)
两种方案将始终是相同的计算机上运行,​​因此不需要联网能力。我已经阅读主题类似的一些问​​题在这里,但我不能完全肯定这对我来说是正确的方法。 (WCF,远程处理,等等。)

I have two C# programs and I want to send some data back and forth between them. (And check if the data arrived to the other application.) The two programs will always run on the same computer, so no networking capability is required. I've already read some questions with similar topics here, but I'm not entirely sure which is the right method for me. (WCF, Remoting, etc.)

我想知道的,是其中之一是落实更容易在C#初学者?
(我不希望它太复杂,无论如何,这只是几个整数和一些文字,我想送。)

What I want to know, is which one is the easier to implement for a beginner in C#? (I don't want it to get too complicated anyway, it's only a few integers and some text that I want to send.)

如果没有在困难真正的改变,做一件有什么优势比其他?

If there isn't a real difference in difficulty, what advantages does one have over the other?

我真的AP preciate一些简单的例子,code为好。

I'd really appreciate some simple example code as well.

先谢谢了。

推荐答案

WCF基本上封装了应用之间在单个封装的通信的各种方法(Web服务,远程处理,MSMQ等),以使它们以编程在同一它们被使用的方式,以及用什么方法的细节留给的之间的结合结构。稍有简化也许,但本质上它是关于

WCF essentially packages up the various methods of communication between applications (web services, remoting, MSMQ etc) in a single package, so that they are programmatically the same in the way that they are used, and the detail of what method is used is left for configuration of the binding between. A slight simplification perhaps, but essentially what it's about.

值得一进入WCF,如果你需要进程间通信,而这肯定是我的意见,以去与此的方式。这是值得看的■设计,谁产生了一些关于这个问题的文章,以及一些可重复使用的code库,你可以找到有用的。他们Juval洛伊还写了关于这个问题的优秀图书

It is worth getting into WCF if you need inter-process communication, and this would certainly be my advice as to the way to go with this. It's worth looking at IDesign, who produce a number of articles on the subject, as well as some reusable code libraries, that you may find useful. Their Juval Lowy has also written an excellent book on the subject,

这篇关于C#应用程序之间的通信 - 轻松的途径的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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