/// <summary> /// 获取验证码图片 /// </summary> /// <returns></returns> public ActionResult ValidateCodeImg() { var Code = ValidateCodeHelper.GetRandomCode(7); ValidateCodeHelper.SetCodeString(Code); return(File(ValidateCodeHelper.GetVerifyCodeImg(Code), "image/Jpeg")); }
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 })); }