Exemplo n.º 1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            string res = MyRequest.createurl_keys();

            types = MyRequest.analysis_keys(res);
            if (!string.IsNullOrEmpty(Request.QueryString["Action"]))
            {
                string   userid    = Request.Form["id"];
                string   userpass1 = Request.Form["pass1"];
                string   userpass2 = Request.Form["pass2"];
                string   str       = Request.Form.Get("like");//"id,value"的形式
                string[] typechar  = str.Split(',');
                string   type      = typechar[1];
                //判断id是否存在
                if (!IsExist(userid))
                {
                    //判断两次密码输入是否一致
                    if (userpass1 == userpass2)
                    {
                        //判断是否注册成功
                        if (IsSuccess(userid, userpass1, type))
                        {
                            ClientScript.RegisterStartupScript(this.GetType(), "", "<script language='javascript'>alert('注册成功!是否前往登陆?')</script>");
                            Response.Redirect("Login.aspx");
                        }
                        else
                        {
                            ClientScript.RegisterStartupScript(this.GetType(), "", "<script language='javascript'>alert('注册失败!')</script>");
                        }
                    }
                    else
                    {
                        ClientScript.RegisterStartupScript(this.GetType(), "", "<script language='javascript'>alert('两次密码输入不一致,请重新输入')</script>");
                    }
                }
                else
                {
                    ClientScript.RegisterStartupScript(this.GetType(), "", "<script language='javascript'>alert('该账号已经被注册!')</script>");
                }
            }
        }