单击链接时启动本地应用程序 [英] Launch a local application when clicking a link

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

问题描述

我正在开发一个内部网络应用程序,它允许我为我的客户存储远程控制凭据.每次我想连接到客户的计算机时,我都需要启动远程支持软件,复制并粘贴用户名和密码,然后点击开始"按钮.该软件将提供命令行参数,允许我立即启动会话,但是,我不知道如何从浏览器应用程序中启动 .exe.

I'm developing an internal web application, that allows me to store remote control credentials for my customers. Every time I want to connect to a customers computer, I need to start the remote support software, copy&paste username and password and then hit the "start" button. The software would have command line arguments available, that allow me to start a session immediately, however, I don't know how to start the .exe from within my browser application.

从 Web 应用程序中的链接启动本地应用程序的选项有哪些?

What are the options to launch a local application from a link in a web application?

推荐答案

您需要为链接中的 URL 设计自定义协议(例如customprotocol://blahblah"),并将您的应用程序注册为外部协议处理程序操作系统.这样,当点击链接时,浏览器就会知道启动处理程序;从中,您可以从 URL 读取传入参数并采取相应措施.

You need to devise a custom protocol for the URLs in your links (e.g. "customprotocol://blahblah") and register your application as an external protocol handler with the OS. This way, when the link is clicked the browser will know to launch the handler; from within that, you can read incoming parameters from the URL and act accordingly.

注册此类协议处理程序的过程是特定于操作系统的.请参阅将应用程序注册到 URL 协议MSDN在 Mozilla KB 上注册协议.

The procedure for registering such a protocol handler is OS-specific. See registering an application to a URL protocol on MSDN and registering a protocol on Mozilla KB.

这篇关于单击链接时启动本地应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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