开发者

Communicating Between .NET Programs

开发者 https://www.devze.com 2022-12-25 12:34 出处:网络
I wanted to set up a simple data communication between two C# applications, and I\'m not sure what the best method is in doing so.I\'ve previously used Java Sockets and开发者_运维问答 ServerSockets to

I wanted to set up a simple data communication between two C# applications, and I'm not sure what the best method is in doing so. I've previously used Java Sockets and开发者_运维问答 ServerSockets to get the job done, but I'm new to C#, so I've come for advice :) It's going to be two way communication with two clients exchanging strings or something of the like.


WCF (Windows Communication Foundation) is what you want.


You have several options:

  1. Using pipes
  2. Using sockets
  3. WCF


You're needing .NET Remoting.

Remoting can be between two apps on the same computer, or across a network.

Here is a good start, the first link is a "Hello World!" remoting application: http://msdn.microsoft.com/en-us/library/kwdt6w2k%28VS.71%29.aspx


I would also take a look at NServiceBus. It's really easy to setup and provides you with a reliable messaging system. Any messages sent between the apps (whether the destination app is online or not) are always delivered. The library leverages MSMQ to facilitate communication.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号