Example #1
0
        /// <summary>
        /// 验证码 GET: /User/ValidCode/1234
        /// </summary>
        /// <param name="aid"></param>
        /// <returns></returns>
        public ActionResult ValidCode(string aid)
        {
            CaptchaImage ci = CaptchaImage.CreateCaptcha(aid);

            using (Bitmap b = ci.RenderImage())
            {
                b.Save(Response.OutputStream, ImageFormat.Jpeg);
            }
            Response.ContentType       = "image/jpeg";
            Response.StatusCode        = 200;
            Response.StatusDescription = "OK";
            return(null);
        }