使用参数从 HTML 启动应用程序 [英] launch an application from HTML with arguments

查看:31
本文介绍了使用参数从 HTML 启动应用程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有没有办法允许 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/etc)?

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 启动应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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