用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()">
posted on 2006-08-01 02:47  北极熊,我来了!  阅读(564)  评论(0编辑  收藏  举报