当前位置: 代码迷 >> JavaScript >> js 调用系统计算器
  详细解决方案

js 调用系统计算器

热度:904   发布时间:2013-11-10 01:02:15.0
<html>    
  <head>    
  <title></title>    
  <meta   http-equiv="Content-Type"   content="text/html;   charset=gb2312">    
    <meta   name="keywords"   content="http://www.daimami.com">    
<script>      
  function   exec   (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>    
  <input   type=button   onclick="exec('calc.exe')"   value=系统计算器>

  相关解决方案