Exemplo n.º 1
0
 //登录
 protected void LoginBtn_Click(object sender, EventArgs e)
 {
     //验证码对比
     if (Session["valid"].ToString().ToUpper() != tbxSecurity.Text.Trim().ToUpper())
     {
         this.Page.ClientScript.RegisterStartupScript(this.GetType(), "", "<script language='javascript'>alert('" + "验证码无效!" + "');</script> ");
     }
     else
     {
         StoreUser           newUser    = new StoreUser();
         StoreUserController newUserCon = new StoreUserController();
         newUser.UserName = this.txbUserName.Text;
         newUser.PassWord = this.txbPassWord.Text;
         //判断是否激活
         if (newUserCon.StoreUserConfirm(newUser) == true)
         {
             //判断是否密码一致
             if (newUserCon.StoreUserLogin(newUser) == true)
             {
                 Session["UserName"] = this.txbUserName.Text;
                 Response.Redirect("PerInf_information.aspx");
             }
             else
             {
                 this.Page.ClientScript.RegisterStartupScript(this.GetType(), "", "<script language='javascript'>alert('" + "密码错误" + "');</script> ");
             }
         }
         else
         {
             this.Page.ClientScript.RegisterStartupScript(this.GetType(), "", "<script language='javascript'>alert('" + "您的账号没有激活" + "');</script>");
         }
     }
 }