public void GetVerifyCode() { string randomcode = VerifyCode.CreateRandomCode(4); HttpContext.Current.Session["VerifyCode"] = randomcode; VerifyCode.CreateImage(randomcode); }
/// <summary> /// 验证码 /// </summary> /// <returns></returns> public ActionResult GetVerifyCode(string type) { string code = VerifyCode.CreateRandomCode(4).ToLower(); LoginUser.Instance.VerificationCode = code; byte[] bytes = VerifyCode.CreateImage(code); return(File(bytes, @"image/jpeg")); }
public FileResult OnGetVCode() { var vcode = VerifyCode.CreateRandomCode(4); HttpContext.Session.SetString("vcode", vcode); var img = VerifyCode.DrawImage(vcode, 20, Color.White); return(File(img, "image/gif")); }
/// <summary> /// 验证码生成 /// </summary> /// <returns></returns> public FileResult VCode() { var vcode = VerifyCode.CreateRandomCode(4); Session["user_vcode"] = vcode; var img = VerifyCode.DrawImage(vcode, 20, Color.White); return(File(img, "image/gif")); }