系统中任何页面都不显示地址栏和工具栏(减少用户恶意修改网址破坏系统)

 我们有时候看到了一些比较好的系统,用户登录界面就去掉了地址栏,然后当用户登录到系统中,系统中的页面也不显示地址栏,这样的好处就是防治用户通过观察地址栏的参数规律来伪造参数连接页面破坏系统。

这里去掉地址栏需要3个页面

1.Default.aspx:这个页面作为部署系统的入口,但其实就是起一个跳转作用,运行时根本看不见该页面

2.Login.aspx:这个页面是正真的登录页面,判断用户账号密码,然后跳转到真正的系统首页

3.MainFramePage.aspx:这个页面是个纯框架的页面,加载了页头、系统主页、页底等

第一个页面:Default.aspx

后台无代码,前台代码如下:

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
    <title>无标题页</title>
        <script type="text/javascript">
    function openChild()
        {
        var h=window.screen.height-65;//获取浏览器分辨率高度 //模拟弹出的登录窗口最大化高度
        var w=window.screen.width-10;//获取浏览器分辨率宽度 //模拟弹出的登录窗口最大化宽度

//打开正真的登录页面Login.aspx("Login.aspx",null,"height="+h+",width="+w+",top=0,left=0,toolbar=no,menubar=no,scrollbars=no,resizable=no,location=no,status=no");   
        window.open('','_top');
        window.top.close();
       
        //关闭IE6不提示
//        function closeie6(){
//        window.opener=null;
//        window.close();

        }
    </script>
</head>
<body οnlοad="openChild()">
</body>
</html>

 

第二个页面:Login.aspx

前台代码

    function openChild()
        {
        var h=window.screen.height-65;//获取浏览器分辨率高度
        var w=window.screen.width-10;//获取浏览器分辨率宽度
        window.open("MainFramePage.aspx",null,"height="+h+",width="+w+",top=0,left=0,toolbar=no,menubar=no,scrollbars=no,resizable=no,location=no,status=no");   
//        window.open('Login.aspx','_top');
//        window.top.close();
        //关闭IE6不提示
//        function closeie6(){
//        window.opener=null;
//        window.close();

        }

后台关键代码如下:

//在点击页面“登录”按钮后调用前台openChild()方法打开系统主页面MainFramePage.aspx

Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "window", "<script>openChild();</script>");

 

第三个页面:MainFramePage.aspx

后台无代码,前台代码如下:

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
    <title>耀莎进销存管理平台</title>
</head>
<frameset id="mame1" rows="60,*,35" marginheight="0" marginwidth="0" frameborder="0">
    <frame id="TopFrame" width="100%" height="60" frameborder="0" src="Head.aspx" scrolling="no" marginheight="0" marginwidth="0"></frame>
    <frameset id="mame2" cols="150,*" marginheight="0" marginwidth="0" frameborder="0"> 
        <frame id="LeftFrame" src="LeftMenu.aspx" scrolling="no"></frame>
        <frame id="RightBottomFrame" name="RightBottomFrame" src="GridView.aspx" scrolling="no"></frame>
    </frameset>
    <frame id="BottomFrame" width="100%" height="35" frameborder="0" src="Feet.aspx" scrolling="no" marginheight="0" marginwidth="0"></frame>
</frameset>
</html>

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值