public virtual void ProcessRequest(HttpContext context) { NameValueCollection queryString = context.Request.QueryString; string text = queryString[CaptchaControl.KEY]; HttpResponse response = context.Response; Bitmap bmp = CaptchaControl.GenerateImage(text); bmp.Save(response.OutputStream, ImageFormat.Jpeg); }
public void ProcessRequest(HttpContext context) { NameValueCollection queryString = context.Request.QueryString; string text = queryString[CaptchaControl.KEY]; HttpResponse response = context.Response; response.ContentType = MediaTypeNames.Image.Jpeg; Bitmap bmp = CaptchaControl.GenerateImage(text); if (bmp != null) { bmp.Save(response.OutputStream, ImageFormat.Jpeg); } }