如何从浏览器与桌面应用程序通信? [英] how to communicate with a desktop application from browser?

查看:638
本文介绍了如何从浏览器与桌面应用程序通信?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否可以通过浏览器与桌面应用程序进行通信?

我想做这样的事情,

可以说我的Web应用程序中有一个带有指向数据源URL的按钮,单击按钮时,桌面应用程序打开并获取该数据源URL并使用桌面应用程序处理数据

这样的事情难吗?您知道任何示例吗?

任何想法如何使firefox扩展程序可以打开程序吗?


关于

Is it possible to communicate with a desktop application from browser?

i want to do something like this,

lets say there is a button in my web application with a url to a data source and when button is clicked desktop application opens and get that data source url and process data with desktop application

is it difficult to do such thing? any examples that you know of?

any idea how to make a firefox extension to open program?


Regards

推荐答案

理论上是可能的.我的意思是,Web浏览器只是应用程序.如果设计了它,它可以做任何您想做的事情 ,因此它也可以与某些桌面应用程序进行通信.

一种实现方法是:您可以创建自己的.NET应用程序,嵌入System.Windows.Controls.WebBrowser(WPF)或System.Windows.Forms.WebBrowser(System.Windows.Forms),请参见:
http://msdn.microsoft.com/en-us/library/system. windows.controls.webbrowser.aspx [ ^ ],
http://msdn.microsoft.com/en-us/library/system. windows.forms.webbrowser.aspx [ ^ ].

另外,在Windows上,IE正式允许使用页面上的ActiveX对象.这是从Web应用程序泄漏"对桌面世界的另一种可能性. (其他一些浏览器以浏览器插件的形式非正式地允许它.)
请参阅:
http://en.wikipedia.org/wiki/ActiveX [ http://msdn.microsoft.com/en-us/library/ie/ms970419.aspx [ ^ ].

本文介绍了为什么这是非常危险的事情: http://en.wikipedia.org/Wiki/Drive-by_download [ ^ ].

通过可靠的知名浏览器从Web应用程序访问台式机的其他官方"方式如何?答案是:他们不这样做,因为如果这样做,就不会被信任-这将是一个严重的安全漏洞.我个人甚至都不信任IE的最新版本来浏览不受信任或未知的网站.我仍然需要令人信服的论点来信任.



关于Firefox扩展的开发,希望您信任自己,如果可以使用它来访问本地计算机.我不太确定您的用户. :-)

您可以看到此手册: http://www.rietta.com/firefox/Tutorial/overview.html [< ^ ].

请参阅原始文档:
https://developer.mozilla.org/en/Extensions [ https://developer.mozilla.org/en/Building_an_Extension [ https://addons.mozilla.org/en-US/firefox/addon/web-developer / [ ^ ].

—SA
It is theoretically possible. I mean, a Web browser is just the application. It can do whatever you want if you design it to do so, so it could communicate with some desktop applications, too.

One way to do it is this: you can create your own .NET application embedding System.Windows.Controls.WebBrowser (WPF) or System.Windows.Forms.WebBrowser (System.Windows.Forms), please see:
http://msdn.microsoft.com/en-us/library/system.windows.controls.webbrowser.aspx[^],
http://msdn.microsoft.com/en-us/library/system.windows.forms.webbrowser.aspx[^].

Also, on Windows, IE officially allows to use an ActiveX object on the page. This is another possibility to "leak" access to the desktop world from the Web application. (Some other browsers allow it unofficially, in the form of browser plug-in.)
Please see:
http://en.wikipedia.org/wiki/ActiveX[^];
this is how: http://msdn.microsoft.com/en-us/library/ie/ms970419.aspx[^].

This article explains why this is a very dangerous thing: http://en.wikipedia.org/wiki/Drive-by_download[^].

How about other "official" ways to access desktop machine from the Web applications by a reliable well-known browsers? The answer is: they don''t do it, because if they did, they could not be trusted — this would be a serious security hole. I personally don''t trust even the latest version of IE to browse non-trusted or unknown sites; I still need convincing arguments to trust.



As to development of Firefox extensions, I hope you can trust yourself if you do it for access to your local machine. I''m less sure about your users. :-)

You can see this manual: http://www.rietta.com/firefox/Tutorial/overview.html[^].

See original documentation:
https://developer.mozilla.org/en/Extensions[^],
https://developer.mozilla.org/en/Building_an_Extension[^],
https://addons.mozilla.org/en-US/firefox/addon/web-developer/[^].

—SA


这篇关于如何从浏览器与桌面应用程序通信?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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