Javascript 如何使用asp.net4从网页启动EXE

Javascript 如何使用asp.net4从网页启动EXE,javascript,internet-explorer,wsh,jscript,Javascript,Internet Explorer,Wsh,Jscript,我使用以下代码: <script> function LaunchApp() { if (!document.all) { alert("Available only with Internet Explorer."); return; } var ws = new ActiveXObject("WScript.Shell"); ws.Exec("C:\\Windows\\notepad.exe"); } 函数Lau

我使用以下代码:

<script>
function LaunchApp() {
    if (!document.all) {
        alert("Available only with Internet Explorer.");
        return;
    }
    var ws = new ActiveXObject("WScript.Shell");
    ws.Exec("C:\\Windows\\notepad.exe");
}

函数LaunchApp(){
如果(!document.all){
警报(“仅适用于Internet Explorer”);
返回;
}
var ws=新的ActiveXObject(“WScript.Shell”);
ws.Exec(“C:\\Windows\\notepad.exe”);
}


但这不起作用。(链接已禁用)

  • 您没有指向相同的JavaScript函数。试试这个:

    运行Exe文件

  • 您的internet设置必须设置为最低安全级别,才能运行此类代码


  • 您需要在IE中具有非常特定的权限才能正常工作。@SimonWhitehead:IE中的特定权限是什么?请帮忙me@nas105我把你的问题重新标记了。这与ASP.NET、.NET或C#无关。是关于JScript和IE的。对不起。我写错了。编辑。。。请帮助我进行互联网设置。
    <a href="javascript:LaunchApp()">Launch the executable</a>