Exemple #1
0
    //登录
    private void LoginCo(string strUserName, string strPw)
    {
        bool   blnIsLogin = objLogin.IsLogin(strUserName, strPw);
        string strLEVEL   = objLogin.GetLEVEL(strUserName);

        if (blnIsLogin)
        {
            bool checkIsLogin = objLogin.checkLogin(strUserName);

            if (checkIsLogin)
            {
                Session["LEVEL"]  = strLEVEL;
                Session["UserID"] = strUserName;

                Response.Cookies["XTDBALLCOUSER"].Value   = strUserName;
                Response.Cookies["XTDBALLCOLV"].Value     = strLEVEL;
                Response.Cookies["XTDBALLCOUSER"].Expires = DateTime.Now.AddHours(24);
                Response.Cookies["XTDBALLCOLV"].Expires   = DateTime.Now.AddHours(24);
                this.SetSXHY(strLEVEL, strUserName);
                this.Setdl(strLEVEL, strUserName, "cg");
                Response.Redirect("~/Page/Welcome.aspx", false);
            }
            else
            {
                this.ShowMsg("該帳號已被鎖定,不能登陸!");
            }
        }
        else
        {
            this.Setdl(strLEVEL, strUserName, "sb");
            this.ShowMsg("帳號或密碼錯誤,請重新登錄!");
            this.textPassWord.Focus();
        }
    }