Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/angular/27.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Angular 在html中执行calc.exe_Angular - Fatal编程技术网

Angular 在html中执行calc.exe

Angular 在html中执行calc.exe,angular,Angular,我正在尝试在html中执行calc.exe <button onclick="window.open('file:\\\C:\Windows\System32\calc.exe')"> Open </button> <a href = "C:\Windows\System32\calc.exe"> go </a> 打开 但我不能这么做 我看到了“ActiveX”,但这只是针对IE,我需要在Chrome中启动calc.exe,IE

我正在尝试在html中执行calc.exe

 <button onclick="window.open('file:\\\C:\Windows\System32\calc.exe')">
   Open
 </button>

 <a href = "C:\Windows\System32\calc.exe"> go </a>

打开
但我不能这么做


我看到了“ActiveX”,但这只是针对IE,我需要在Chrome中启动calc.exe,IE、Mozilla和“Angular6”或JS或Jquery,我如何才能做到这一点?谢谢。

不,您不能这样做,因为这将是一个巨大的安全漏洞,允许网站在您的操作系统级别执行命令。

我建议使用electron或您自己编写解决方案。对于自己的解决方案,我指的是任何语言的本地服务器应用程序,它接收web请求(wss、rest…)并在您的机器上执行命令。

不可能。Exe永远不能通过web运行。您可以使用electron与操作系统程序通信。浏览器不允许您使用。