protected void Page_Load(object sender, EventArgs e) { //禁用客户端缓存 Response.Buffer = true; Response.ExpiresAbsolute = System.DateTime.Now.AddSeconds(-1); Response.Expires = 0; Response.CacheControl = "no-cache"; VerifyCode v = new VerifyCode(); v.Length = this.length; v.FontSize = this.fontSize; v.Chaos = this.chaos; v.BackgroundColor = this.backgroundColor; v.ChaosColor = this.chaosColor; v.CodeSerial = this.codeSerial; v.Colors = this.colors; v.Fonts = this.fonts; v.Padding = this.padding; string code = v.CreateVerifyCode(); //取随机码 v.CreateImageOnPage(code, this.Context); // 输出图片 Session["CheckVerifyCode"] = code.ToLower(); // 使用Session["CheckCode"]取验证码的值 //Response.Cookies.Add(new HttpCookie("VerifyCode", code.ToLower()));// 使用Cookies取验证码的值 }
protected void Page_Load(object sender, EventArgs e) { VerifyCode v = new VerifyCode(); v.Length = this.length; v.FontSize = this.fontSize; v.Chaos = this.chaos; v.BackgroundColor = this.backgroundColor; v.ChaosColor = this.chaosColor; v.CodeSerial = this.codeSerial; v.Colors = this.colors; v.Fonts = this.fonts; v.Padding = this.padding; string code = v.CreateVerifyCode(); //取随机码 v.CreateImageOnPage(code, this.Context); // 输出图片 // 用于验证的Session //Session["ValidateCode_Page"] = null; //Session["ValidateCode_Page"] = str_ValidateCode; // 使用Cookies取验证码的值 if (LJSheng.Common.LCommon.IsURLName(Request.QueryString["name"])) { Response.Cookies.Add(new HttpCookie(Request.QueryString["name"], code.ToUpper())); // 使用Cookies取验证码的值 } else { Response.Cookies.Add(new HttpCookie("CheckCode", code.ToUpper())); // 使用Cookies取验证码的值 } }
protected void Page_Load(object sender, EventArgs e) { VerifyCode vf = new VerifyCode(); string verifyCode = vf.CreateVerifyCode(4); Session["verifyCode"] = verifyCode; vf.CreateImageOnPage(verifyCode, HttpContext.Current); }
public void ProcessRequest(HttpContext Context) { VerifyCode vc = new VerifyCode(); vc.FontSize = 11; vc.Padding = 3; vc.CreateImageOnPage(vc.CreateForWordCode(), Context); }
protected void Page_Load(object sender, EventArgs e) { VerifyCode v = new VerifyCode(); string code = v.CreateVerifyCode(); //取随机码 v.CreateImageOnPage(code, this.Context); // 输出图片 // 使用Cookies取验证码的值 Response.Cookies.Add(new HttpCookie("CheckCode", code.ToLower())); }
protected void Page_Load(object sender, EventArgs e) { VerifyCode v = new VerifyCode(); string code = v.CreateVerifyCode(4);//验证码长度 v.CreateImageOnPage(code, this.Context); if (!string.IsNullOrEmpty(Request.QueryString["name"])) { Session[Request.QueryString["name"].Trim()] = code; } Session["VerifyCode"] = code; }
protected void Page_Load(object sender, EventArgs e) { VerifyCode v = new VerifyCode(); v.Length = this.length; v.FontSize = this.fontSize; v.Chaos = this.chaos; v.BackgroundColor = this.backgroundColor; v.ChaosColor = this.chaosColor; v.CodeSerial = this.codeSerial; v.Colors = this.colors; v.Fonts = this.fonts; v.Padding = this.padding; string code = v.CreateVerifyCode(); //取随机码 v.CreateImageOnPage(code, this.Context); // 输出图片 Response.Cookies.Add(new HttpCookie("CheckCode", code.ToUpper())); // 使用Cookies取验证码的值 }
protected void Page_Load(object sender, EventArgs e) { VerifyCode v = new VerifyCode(); v.Length = this.length; v.FontSize = this.fontSize; v.Chaos = this.chaos; v.BackgroundColor = this.backgroundColor; v.ChaosColor = this.chaosColor; v.CodeSerial = this.codeSerial; v.Colors = this.colors; v.Fonts = this.fonts; v.Padding = this.padding; string code = v.CreateVerifyCode(); //取随机码 v.CreateImageOnPage(code, this.Context); // 输出图片 Session["CheckCode"] = code.ToUpper(); //用于客户端校验码比较 }
protected void Page_Load(object sender, EventArgs e) { VerifyCode v = new VerifyCode(); v.Length = this.length; v.FontSize = this.fontSize; v.Chaos = this.chaos; v.BackgroundColor = this.backgroundColor; v.ChaosColor = this.chaosColor; v.CodeSerial = this.codeSerial; v.Colors = this.colors; v.Fonts = this.fonts; v.Padding = this.padding; string code = v.CreateVerifyCode(); //取随机码 v.CreateImageOnPage(code, this.Context); // 输出图片 Response.Cookies.Add(new HttpCookie("CheckCode", code.ToUpper()));// 使用Cookies取验证码的值 }