// Create a CAPTCHA image using the text stored in the Session object. protected void Page_Load(object sender, EventArgs e) { CaptchaImage.CaptchaImage ci = new CaptchaImage.CaptchaImage(Session["CaptchaCode"].ToString(), 200, 50, "Century Schoolbook"); // Change the response headers to output a JPEG image. Controls.Clear(); Response.Clear(); Response.ContentType = "image/jpeg"; // Write the image to the response stream in JPEG format. ci.Image.Save(Response.OutputStream, ImageFormat.Jpeg); // Dispose of the CAPTCHA image object. ci.Dispose(); }
private void Page_Load(object sender, System.EventArgs e) { // Create a CAPTCHA image using the text stored in the Session object. CaptchaImage ci = new CaptchaImage(this.Session["CaptchaImageText"].ToString(), 200, 50, "Century Schoolbook"); // Change the response headers to output a JPEG image. this.Response.Clear(); this.Response.ContentType = "image/jpeg"; // Write the image to the response stream in JPEG format. ci.Image.Save(this.Response.OutputStream, ImageFormat.Jpeg); // Dispose of the CAPTCHA image object. ci.Dispose(); }
private void Page_Load(object sender, System.EventArgs e) { // Create a CAPTCHA image using the text stored in the Session object. CaptchaImage wb = new CaptchaImage("", 1, 1, "Arial"); // Change the response headers to output a JPEG image. this.Response.Clear(); this.Response.ContentType = "image/jpeg"; // Write the image to the response stream in JPEG format. wb.Image.Save(this.Response.OutputStream, ImageFormat.Jpeg); // Dispose of the CAPTCHA image object. wb.Dispose(); HttpCookie WebBug = Request.Cookies["TRACK"]; if (WebBug == null) { WebBug = new HttpCookie("TRACK"); WebBug.Value = "QlP7Myt3zfSMlSwEIh5I6dtyo"; Response.Cookies.Add(WebBug); } }