Ejemplo n.º 1
0
        public ActionResult Register(string Account, string RealName, string Password, string verifycode)
        {
            verifycode = Md5Helper.MD5(verifycode.ToLower(), 16);
            if (Session["session_verifycode"].IsEmpty() || verifycode != Session["session_verifycode"].ToString())
            {
                return(Error("验证码错误,请重新输入"));
            }
            //验证账号是否存在
            if (_app.ExistAccount(Account))
            {
                return(Error("该账号已存在"));
            }
            UserEntity userEntity = new UserEntity();

            userEntity.Account   = Account;
            userEntity.RealName  = RealName;
            userEntity.Password  = Password;
            userEntity.Secretkey = Md5Helper.MD5(CommonHelper.CreateNo(), 16).ToLower();
            userEntity.Password  = Md5Helper.MD5(DESEncrypt.Encrypt(Md5Helper.MD5(userEntity.Password, 32).ToLower(), userEntity.Secretkey).ToLower(), 32).ToLower();
            _app.CreateForm(userEntity);
            return(Success("注册成功。"));
        }