[英]Website to connect to a client desktop application
I have an application written in VB.net that runs on a clients pc. 我有一个用VB.net编写的在客户端PC上运行的应用程序。 I also have a website written in mostly javascript, http and php.
我也有一个主要用javascript,http和php编写的网站。 The thing I want to do is to connect the website to the application , so that when ie a certain button is pressed, it connects to the client application and raises an event.
我想做的就是将网站连接到应用程序 ,以便当按下某个按钮时,它将连接到客户端应用程序并引发一个事件。
I have tried approaches like TCP socket communication by having a TCP Socket Server running in the background of the client application. 我已经尝试通过在客户端应用程序的后台运行TCP套接字服务器来尝试类似TCP套接字通信的方法。 I can connect to the server by having a client connection from another vb.net application, but whenever I try to connect through PHP it fails.
我可以通过与另一个vb.net应用程序建立客户端连接来连接到服务器,但是每当我尝试通过PHP连接时,它都会失败。 (I have only tried PHP since server-side scripting seems to make more sense in this case)
(我只尝试过PHP,因为在这种情况下服务器端脚本似乎更有意义)
Another approach I have tried is to have an HTTP server running in the background of my desktop application and then have a PHP script connect to it, that fails as well. 我尝试过的另一种方法是让HTTP服务器在桌面应用程序的后台运行,然后将PHP脚本连接到该服务器,这也会失败。
One thing that I've been thinking about as a last resort is to simply have a textfile on the webserver and a PHP script writing to it after given parameters and then have the client application to read the file every few seconds. 我一直想做的一件事是,在网络服务器上简单地放置一个文本文件,并在给定参数之后编写一个PHP脚本,然后让客户端应用程序每隔几秒钟读取一次该文件。 But this wouldn't be very efficient with larger amounts of data, would it?
但这对大量数据不是很有效,对吗?
What is the proper way of doing this? 正确的做法是什么? If you have any questions about the code I've been using, feel free to ask.
如果您对我一直在使用的代码有任何疑问,请随时提出。
If you don't get my blurry explanation, try this image: http://i.imgur.com/8njxVFj.png 如果您没有得到我的模糊解释,请尝试以下图像: http : //i.imgur.com/8njxVFj.png
Thanks in advance. 提前致谢。
为了使您的数据更有条理,我建议您将数据存储在数据库服务器上,例如mysql(免费)。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.