Esempio n. 1
0
        /// <summary>
        /// 获取验证码图片
        /// </summary>
        /// <returns></returns>
        public ActionResult ValidateCodeImg()
        {
            var Code = ValidateCodeHelper.GetRandomCode(7);

            ValidateCodeHelper.SetCodeString(Code);
            return(File(ValidateCodeHelper.GetVerifyCodeImg(Code), "image/Jpeg"));
        }
Esempio n. 2
0
        public void RegisterTest()
        {
            var Code = ValidateCodeHelper.GetRandomCode(7);

            ValidateCodeHelper.SetCodeString(Code);
            Assert.IsTrue(DefaultService.Register(new ResultModel(), new Model.RegisterModel {
                Password = "******", RePassword = "******", Telephone = "123456", UserName = "******", VerisonCode = Code
            }));
        }