Ejemplo n.º 1
0
 /// <summary>
 /// WebForm输出方法(在单独的页面输出)
 /// </summary>
 /// <param name="context"></param>
 public void CreateImageOnPage(System.Web.HttpContext context)
 {
     ValidateCode vCode = new ValidateCode();
     string code = vCode.CreateValidateCode(4);
     byte[] bytes = vCode.CreateValidateGraphic(code);
     context.Response.ClearContent();
     context.Response.ContentType = "image/Jpeg";
     context.Response.BinaryWrite(bytes);
 }