Beispiel #1
0
        public ActionResult Captcha(int imageWidth = 200, int imageHeight = 45)
        {
            var code    = "";
            var images  = _captchaService.GetValidationImage(out code, imageWidth, imageHeight);
            var setting = _settingService.GetCustomerSettings();

            Session[setting.CaptchaName] = code;
            return(File(images, @"image/jpeg"));  //返回验证码图片
        }