有没有一种方法可以使HTML链接从本地计算机运行程序? [英] Is there a way to make a HTML link that would run a program from local computer?

查看:56
本文介绍了有没有一种方法可以使HTML链接从本地计算机运行程序?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

出于调试目的,如果我可以让我的错误页面在异常堆栈跟踪中显示可点击的文件名,这会很好,该跟踪将在我最喜欢的编辑器中打开它们。但是,这需要我执行完整的命令行-指向文件的简单链接将无效。可以做到这一点吗?

For debugging purposes it'd be nice if I could make my error page display clickable file names in exception stack traces that would open them up in my favorite editor. However this would require me to execute a full command line - a simple link to a file will not do. Can this be done?

该解决方案可以仅用于IE,并且可以使用需要完全信任的技术(无论如何,我不希望这样做)。人们只会在localhost上使用此功能,实际上,当我远程查看页面时,我会禁用此功能。

The solution can be IE-only and it can use techniques that require full trust (I don't expect it to be otherwise anyway). People are only going to use this on localhost, I will in fact disable this functionality when viewing the page remotely.

推荐答案

此处所示,向Windows添加新协议

You can add a new protocol to Windows as outlined here .

这特别好,因为它可跨浏览器运行,并且不需要任何特定于浏览器的设置。

This is especially nice because it works across browsers, and doesn't require any browser specific settings.

请务必小心-添加新的协议处理程序会打开潜在的漏洞,尽管这些漏洞非常遥远。进行设置时,切勿让传入的URL成为通用命令解释器的参数(例如 cmd )。始终将其链接到无法进行任何破坏性操作的现有应用程序,即使通过命令行开关也是如此。

Just be careful with it - adding a new protocol handler opens potential, although very remote, vulnerabilities. When setting this up, never let the incoming URL be somehow a parameter to a generic command interpreter (like cmd). Always link it to an existing application that is not able to do anything destructive, not even through command line switches.

这篇关于有没有一种方法可以使HTML链接从本地计算机运行程序?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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