如何远程连接两个应用程序 [英] How do I connect two applications remotely

查看:106
本文介绍了如何远程连接两个应用程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在不同的计算机上有两个Windows窗体应用程序。我想要做的是当我单击其中一个表单上的按钮时,命令将被发送到另一台计算机而另一台计算机将响应。我想远程执行此操作,而不是在与电缆连接的计算机之间,例如,它可能是位于不同大陆的计算机。



示例代码非常精彩。

I have two Windows Forms applications on different computers. What I want to do is when I click a button on one of the forms a command will be sent to the other computer and the other computer would respond. I want to do this remotely not between computers connected with a cable it could be computers that are on different continents for instance.

An example code would be splendid.

推荐答案

我说在你的情况下通过TCP / IP声音进行通信是可行的。也许这些文章会有所帮助:

- 使用C#进行.NET套接字编程简介 [ ^ ]

- < a href =http://www.codeproject.com/Articles/155282/TCP-Server-Client-Communication-Implementation?fid=1609087&df=90&mpp=25&noise=3&prof=False&sort=位置&视图=正常& spc =宽松& fr = 26#xx0xx> C#.NET中的完整TCP服务器/客户端通信和RMI框架 - 实现 [ ^ ]
I'd say communication over TCP/IP sound feasible in your case. Perhaps these articles would be helpful:
- An Introduction to Socket Programming in .NET using C#[^]
-A Complete TCP Server/Client Communication and RMI Framework in C# .NET - Implementation[^]


它可以在几个不同级别的网络,远程处理或WCF之一上完成。

请参阅我的概述这些方法在我过去的解决方案中:

我如何将byte []发送到其他电脑 [ ^ ],

通信b / w局域网上的两个Windows应用程序。 [ ^ ]。



-SA
It can be done on one of several different levels of networking, remoting or WCF.
Please see my overview of these approaches in my past solutions:
how i can send byte[] to other pc[^],
Communication b/w two Windows applications on LAN.[^].

—SA


也许信号器也可能很有趣。

你会发现很多信息:

http://www.asp.net/signal r / overview / guide-to-the-api / hubs-api-guide-net-client



这取决于你的最终目标。也许你想拥有一个多个webclients而不只是winforms ....
Maybe signalr could also be interesting.
A lot of information you will find on:
http://www.asp.net/signalr/overview/guide-to-the-api/hubs-api-guide-net-client

It depends on your final target. Maybe you like to have also one ore multiple webclients instead only winforms....


这篇关于如何远程连接两个应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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