问题描述
有没有一种方法可以让一个HTML文件到本地计算机上打开一个应用程序,并发送该应用程序的参数?
Is there a way to allow an HTML file to open an application on the local computer and send that application arguments?
我们有一个应用程序,允许用户设置链接到外部应用程序。我们还提供一个HTML摘要页面(他们通常从浏览器之外的应用程序进行交互)在HTML中的链接也是如此。我们可以让应用程序启动,如果该程序存在,但似乎无法通过HTML链接发送参数。
We have an application that allows a user to set a link to an external application. We also provide a summary page in HTML (they usually interact with the application from outside the browser) with the link in HTML as well. We can get applications to launch if the program exists, but cant seem to send arguments through the HTML link.
这甚至可能吗?
是否有可能无需安装一些客户端(如Silverlight的/ Java Web Start的/等)?
Is it possible without installing something client-side (like silverlight/java web start/etc)?
推荐答案
您不能直接启动从HTML / JavaScript的应用程序。如果你有一个自定义的应用程序已经安装,你可以注册一个协议处理程序,并重定向到该自定义URL,这又与完整的URL可以启动应用程序。是这样的:
You can't directly launch an application from HTML/JavaScript. If you have a custom application already installed, you can register a protocol handler and the redirect to that custom url, which in turn launches your application with the full url available. Something like:
mycustomapp://whatever/whatever?arg1=value&arg2=value
这篇关于从推出的HTML与参数的应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!