且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

在网站(asp.net)的客户端上运行exe文件

更新时间:2022-03-14 22:23:22

由于存在很高的安全风险,因此如果没有现代浏览器中的用户操作,您将无法做到这一点.您可以在IE6中使用WScript.Shell,但现在不行了.在这种情况下,用户操作"实际上是在客户端上安装一些东西.因此,您实际上可以使其与ActiveX,Java等一起使用,但是在调用它之前必须先在客户端安装它.
但这确实是一个有趣且清晰的解决方案:使用协议处理程序.参见此处: http://www.openwinforms.com/run_exe_from_javascript.html [
Due to high security risk, you cannot do this without user action in the modern browsers. You could in IE6 with WScript.Shell, but not anymore. "User action" in this case is actually installing something on client side. So you can actually make it work with ActiveX, Java, etc, but it has to be something installed on client side before invoking it.
But this is really an interesting and clear solution: use protocol handler. See here: http://www.openwinforms.com/run_exe_from_javascript.html[^]