如何使用JavaScript打开Windows程序? [英] How to Open a Windows Program with JavaScript?

查看:619
本文介绍了如何使用JavaScript打开Windows程序?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

因此,我正在尝试制作一个Windows的项目中心(通过Localhost在本地运行),单击按钮即可打开不同的应用程序(例如CAD程序).这不安全吗?如果没有,我该怎么办?如果是这样,还有其他选择吗?谢谢!

So I'm trying to make a projects hub for Windows (run locally with Localhost) that will open different apps (e.g. a CAD program) at the click of a button. Is this insecure? If not, how would I do it? If so, is there an alternative? Thanks!

推荐答案

URI(统一资源标识符)将提供最佳的用户体验. URI是可以启动应用程序以及将数据传递到应用程序中的架构. URI的最常见示例是 mailto: ,用于从网站启动计算机的邮件客户端.

A URI (Uniform Resource Identifier) will provide for the best user experience. A URI is a schema that can launch an application as well as pass data into the application. The most common example of a URI is the mailto: for launching a computer's mail client from a website.

创建URI涉及编辑注册表.这是一些有关如何执行此操作的Microsoft文档.查看注册表中的其他示例,例如 mailto: https://msdn.microsoft.com/en -us/library/aa767914(v = vs.85).aspx

Creating a URI involves editing the registry. Here is some Microsoft Documentation on how to do it. Looking at other examples in the registry like mailto: https://msdn.microsoft.com/en-us/library/aa767914(v=vs.85).aspx

最后,我已经看到人们使用<a href="path.lnk">来快捷链接,这些链接在Internet Explorer中可以正常工作.您仍然会提示您打开或保存;但是,这是最简单的解决方案.

Lastly, I have seen people use <a href="path.lnk"> to shortcut links that works ok in Internet Explorer. You will still get a prompt to open or save; however, its the simplest solution.

这篇关于如何使用JavaScript打开Windows程序?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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