12345678910111213141516171819202122232425262728293031323334 |
- using PersonalBlog.App_Code;
- using System;
- using System.Collections.Generic;
- using System.Drawing;
- using System.Linq;
- using System.Web;
- using System.Web.Mvc;
- namespace PersonalBlog.Controllers
- {
- public class HomeController : Controller
- {
- // GET: Home
- public ActionResult Index()
- {
- return View();
- }
- public ActionResult Blog()
- {
- return View();
- }
- public FileResult ValidCode()
- {
- ValidateCode __validateCode = new ValidateCode();
- string code = __validateCode.CreateVerifyCode();
- Session["validateCode"] = code;
- Bitmap __bm = __validateCode.CreateImageCode(code);
- byte[] bytes = Tools.ConvertHelper.BitmapToBytes(__bm);
- return File(bytes, @"image/Jpeg");
- }
- }
- }
|