Ejemplo n.º 1
0
    protected void Page_Load(object sender, EventArgs e)
    {
        Page.Title = " 管理系统";

        string errorStr = Request.QueryString["errorTitle"];

        if (!string.IsNullOrEmpty(errorStr as string))
        {
            xc.divError(string.Empty, Server.UrlDecode(errorStr), 400, 150, "?errorUrl=" + Server.UrlEncode(Request.QueryString["errorUrl"]), "top");
        }
        else
        {
            if (!String.IsNullOrEmpty(Session["AdminRndNums"] as string)) //基本session验证免登陆
            {
                Response.Redirect("admin.aspx", true);
            }
        }

        if (!IsPostBack)
        {
            ClientName.Text = Request.Url.Host;
            WebVer.Text     = "管理系统 " + xc.XabaraVer.ToString().Trim();

            if (Request.Cookies["XabaraAdmin"] != null)
            {
                UID.Text = Request.Cookies["XabaraAdmin"]["AdminID"].Trim();
            }

            clintIE.Text    = xc.clientBrower(1);
            clintIEver.Text = xc.clientBrower(2);

            if (xc.clientBrower(1).ToLower().Equals("ie"))               //判断浏览器
            {
                if (Convert.ToDouble(xc.clientBrower(2).ToString()) < 8) //判断浏览器版本
                {
                    ieError.Text = @"<strong>版本提示:</strong>为了更好的体验本管理系统,我们建议您升级 <a href='http://www.microsoft.com/china/windows/internet-explorer/default.aspx' target='_blank' style='color:red;font-weight:bold;'>Internet Explorer</a> 新版浏览器!";
                }
            }

            //string clientIP = xc.GetIP();
            //ipStr.Text = "<span style=\"color:red;\">" + clientIP + "</span>&nbsp;" + xc.GetIpWhere(clientIP);
            //ip限制
            //string ips = XmlReader.GetConfig(Server.MapPath("~/xabara.config"), "ip");
            //if (!string.IsNullOrEmpty(ips as string))
            //{
            //    if (ips.IndexOf(clientIP) < 0)
            //    {
            //        ipStr.Text += " <span class=\"redF\">您的IP不允许登录!</span>";
            //        imgLogin.Enabled = false;
            //        UID.Enabled = false;
            //        PW.Enabled = false;
            //        RndNum.Enabled = false;
            //    }
            //}

            //FormCheck fCheck = new FormCheck();
            //UIDRegularExpressionValidator.ValidationExpression = fCheck.RegExpressionValidator("userID", 3, 20, false);
            //UIDRegularExpressionValidator.ErrorMessage = fCheck.RegExpressionValidator("userID", 3, 20, true);
            //PWRegularExpressionValidator.ValidationExpression = fCheck.RegExpressionValidator("passWord", 8, 20, false);
            //PWRegularExpressionValidator.ErrorMessage = fCheck.RegExpressionValidator("passWord", 8, 20, true);
            //RndNumReg.ValidationExpression = fCheck.RegExpressionValidator("rndNums", 0, 0, false);
            //RndNumReg.ErrorMessage = fCheck.RegExpressionValidator("rndNums", 0, 0, true);

            //RndNum.Attributes.Add("onfocus", "MM_showHideLayers('rndgetValidate', '', 'show')");
        }
    }