简体   繁体   English

通过Internet远程联系桌面应用程序的最佳方法

[英]Best way to contact Desktop application remotely via Internet

I want to pass certain parameters to a desktop application remotely via the internet. 我想通过互联网将某些参数远程传递到桌面应用程序。 I don't want my application to contact the server repeatedly, because many such applications can bring the server down easily. 我不希望我的应用程序重复与服务器联系,因为许多这样的应用程序可以使服务器轻松停机。 Is there a way to initiate the connection from the server? 有没有办法从服务器启动连接? How can I identify the applications, as there will many of them running on many computers somewhere around the globe. 我如何识别应用程序,因为在全球各地的许多计算机上都会运行许多应用程序。 I don't know where to start - I'm trying to do this in C# and ASP.NET/PHP on the server-side. 我不知道从哪里开始-我正在尝试在服务器端的C#和ASP.NET/PHP中执行此操作。 Please give some advice. 请给一些建议。

Is there a way to initiate the connection from the server? 有没有办法从服务器启动连接?

No. Not without having the client contact with the server first, informing it with the IP address, port to use etc... Which the server will need to keep for each client, hoping that they don't change (or get updated when they do change). 否。并非没有让客户端首先与服务器联系,并告知其IP地址,要使用的端口等...服务器需要为每个客户端保留哪些地址,希望它们不会更改(或在更新时更新)他们确实会改变)。

Long polling by the client is the right solution for what you are doing, even if you don't want to use it. 即使您不想使用客户端,长时间的轮询也是您正在做的事情的正确解决方案。

There are many different ways you could approach this, just thinking out of the box, both your app and the server could utilize a different mechanism for transferring the settings. 您可以采用多种不同的方法来实现此目的,只是开箱即用,您的应用程序和服务器都可以利用不同的机制来传输设置。 I'm not recommending any of these methods, please don't shoot me down, they are all just ideas. 我不推荐这些方法中的任何一种,请不要让我失望,它们只是想法。

As an example, your server could connect out using FTP and output the updated settings to an FTP server on each PC. 例如,您的服务器可以使用FTP进行连接,并将更新的设置输出到每台PC上的FTP服务器。 You could install something like Filezilla on each machine which runs your app. 您可以在运行应用程序的每台计算机上安装Filezilla之类的东西。 You'd obviously need to configure port forwarding on the router to allow the server FTP access. 您显然需要在路由器上配置端口转发,以允许服务器FTP访问。

You could use email. 您可以使用电子邮件。 Setting up an email account where your server can login to send out the settings. 设置一个电子邮件帐户,服务器可以在其中登录以发送设置。 Your app could possibly login to the same email account possibly even a single Gmail account to retrieve the settings. 您的应用程序可能登录到相同的电子邮件帐户,甚至可能登录到一个Gmail帐户来检索设置。

Another idea would be to use a file sharing service like Dropbox, Google Drive or similar and where the settings could be shared. 另一个想法是使用文件共享服务,例如Dropbox,Google Drive或类似文件,并在其中共享设置。 Obviously this would involve learning any API and I'm not sure if there are any restrictions on this approach. 显然,这将涉及学习任何API,并且我不确定此方法是否有任何限制。

The last idea and probably my preferred approach would be to host a web service and database on a remote server, both your server and the applications would connect to the same service to transfer the settings. 最后一个想法(可能是我的首选方法)是在远程服务器上托管Web服务和数据库,您的服务器和应用程序都将连接到同一服务以传输设置。 This approach is obviously firewall/router friendly as all the clients connect out to the web service to collect the required data. 由于所有客户端都连接到Web服务以收集所需数据,因此该方法显然对防火墙/路由器友好。

Hope this helps? 希望这可以帮助?

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

相关问题 监视桌面应用程序的最佳方法是什么? - What's the best way to watchdog a desktop application? 远程访问C#桌面应用程序 - Accessing c# desktop application remotely 从网站远程启动桌面应用程序 - Remotely launching a desktop application from a web site 在桌面应用程序的后台远程运行守护进程 - Running a Daemon remotely and in the background of Desktop Application 数据库桌面应用程序权限管理的最佳方法是什么? - What is the Best way for database desktop application permission managing? 保留/缓存数据集以在桌面应用程序上重用的最佳方法 - Best way to keep/cach Dataset for reuse on a desktop application C# 桌面应用程序到 Web 应用程序的最佳方式 - Best way for C# desktop app to Web application .NET - 在桌面应用程序中存储加密离线数据的最佳方式 - .NET - Best way to store encrypted offline data in Desktop Application 通过Internet向开发人员发送应用程序错误和日志的最佳方法是什么? - What is the best way to send application errors and logs by internet to the developers? 无需Internet查找即可确保付费应用程序的最佳方法 - Best way without an internet lookup to secure a paid for application
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM