Ejemplo n.º 1
0
        protected void Button_register_Click(object sender, EventArgs e)
        {
            string Account  = TextBox_account.Text.Trim();
            string Password = TextBox_psw.Text.Trim();
            string Phone    = TextBox_phone.Text.Trim();
            string IdCard   = TextBox_IdCard.Text.Trim();

            bool result = CheckInput(Account, Password, Phone, IdCard);

            if (result)
            {
                // 判断帐号是否存在,若帐号不存在则添加
                bool isExit = UserTool.Exist(Account);
                if (isExit)
                {
                    Label_TipInfo.Text = "帐号“" + Account + "”已存在,请使用其它昵称!";
                }
                else
                {
                    string msg = UserTool.Add(Account, Password, Phone, IdCard);
                    Label_TipInfo.Text = "恭喜,帐号注册成功!";

                    //ScTool.Alert("恭喜,帐号注册成功!");
                    Response.Redirect("UserLogin.aspx?Account=" + Account);
                }
            }
        }