用Asp.net屏蔽F5、Ctrl+N、Alt+F4
<script language="javascript">
function DisableKey()
{
//8 退格键
//78 Ctrl+N
//37 Alt+ 方向键 ←
//39 Alt+ 方向键 →
//116 F5 刷新键
//82 Ctrl + R
//121 shift+F10
//115 屏蔽Alt+F4
//屏蔽 shift 加鼠标左键新开一网页
if (window.event.keyCode==8
||event.keyCode==78
||event.keyCode==37
||event.keyCode==39
||event.keyCode==116
||event.keyCode==82
||event.keyCode==121
||event.keyCode==115
||(window.event.srcElement.tagName == "A" && window.event.shiftKey))
{
alert('请通过事物代码进行操作!');
window.event.returnValue=false;
}
}
</script>
</HEAD>
<body MS_POSITIONING="GridLayout" onKeyDown="DisableKey()">
function DisableKey()
{
//8 退格键
//78 Ctrl+N
//37 Alt+ 方向键 ←
//39 Alt+ 方向键 →
//116 F5 刷新键
//82 Ctrl + R
//121 shift+F10
//115 屏蔽Alt+F4
//屏蔽 shift 加鼠标左键新开一网页
if (window.event.keyCode==8
||event.keyCode==78
||event.keyCode==37
||event.keyCode==39
||event.keyCode==116
||event.keyCode==82
||event.keyCode==121
||event.keyCode==115
||(window.event.srcElement.tagName == "A" && window.event.shiftKey))
{
alert('请通过事物代码进行操作!');
window.event.returnValue=false;
}
}
</script>
</HEAD>
<body MS_POSITIONING="GridLayout" onKeyDown="DisableKey()">
作者:Apollo
出处:http://apollo.cnblogs.com/
如果您觉得本文对您的学习有所帮助,可通过“微信”或“支付宝”打赏博主,或者点击页面右下角【好文要顶】支持博主。