protected void Page_Load(object sender, EventArgs e) { VerifyImg v = new VerifyImg(); 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(); //Session["VerifyCode"] = null; Session["VerifyCode"] = code.ToLower(); //Log4Net.Error("VerifyCode = " + Session["VerifyCode"].ToString()); v.CreateImageOnPage(code, this.Context); //Response.Cookies.Add(new HttpCookie("CheckCode", code.ToUpper()));// 使用Cookies取验证码的值 //Session["VerifyCode2"] = code.ToLower(); }