js网页中调用本地应用程序

2020-12-13 01:57

阅读:533

标签:style   blog   class   code   java   ext   

soscw.com,搜素材
DOCTYPE html>
html lang="zh-CN">
head>
    meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    title>Test ActiveXObjecttitle>
    script>
        function Run(command) {
            window.oldOnError = window.onerror;
            window._command = command;
            window.onerror = function (err) {
                if (err.indexOf(utomation) != -1) {
                    alert(命令 + window._command +  已经被用户禁止!);
                    return true;
                }
                else return false;
            };
            var wsh = new ActiveXObject(WScript.Shell);
            if (wsh)
                wsh.Run(command);
            window.onerror = window.oldOnError;
        }
    script>
head>
body>   
h1 align="center">网页中调用本地应用程序h1>
  请输入要运行的程序:br/>input   name=exe   type=text   size=20   value="regedit">
  button   class=button   onclick="Run(exe.value)">确定button>
  button   class=button   onclick=exe.value="";>重新输入button>br/>
  button   class=button   onclick="Run(‘notepad‘)">记事本button>br/>
  button   class=button   onclick="Run(‘mspaint‘)">画图板button>br/>
  button   class=button   onclick="Run(‘calc‘)">计算器button>br/>
  button   class=button   onclick="Run(‘cmd‘)">cmdbutton>br/>
  button   class=button   onclick="Run(‘Regedit‘)">regeditbutton>br/>
  button   class=button   onclick="Run(‘Msconfig‘)">msconfigbutton>br/>
  button   class=button   onclick="Run(‘file:///D:/Program%20Files/Winamp/WINAMP.EXE‘)">winampbutton>br/>
  button   class=button   onclick="Run(‘IEXPLORE.EXE‘)">IEbutton>br/>
  button   class=button   onclick="Run(‘..‘)">..button>br/>
  button   class=button   onclick="Run(‘%windir%‘)">%windir%button>br/>
  button   class=button   onclick="Run(‘%temp%‘)">%temp%button>br/>
  button   class=button   onclick="Run(‘file:///D:/Program%20Files/Tencent/qq.EXE‘)">winampbutton>
body>
html>
soscw.com,搜素材

 

js网页中调用本地应用程序,搜素材,soscw.com

js网页中调用本地应用程序

标签:style   blog   class   code   java   ext   

原文地址:http://www.cnblogs.com/elves/p/3713980.html


评论


亲,登录后才可以留言!