Пример #1
0
        public IActionResult GetCode()
        {
            //var (code, bytes) = CaptchaHelper.GenVCode(4);

            //// code handle logic
            //System.Console.WriteLine(code);
            //Console.WriteLine(++count);

            //return File(bytes, "image/png");

            //_captchaService.SetOptions(new CaptchaOptions()
            //{
            //    Height = 35,
            //    Width = 90
            //});

            var text  = _captchaService.GetRandomText(5);
            var bytes = _captchaService.GetCaptcha(text);

            Console.WriteLine(text);
            Console.WriteLine(++count);
            return(File(bytes, "image/png"));
        }