Exemplo n.º 1
0
        public static void AddSessionBasedCaptcha(this IServiceCollection services, Action <BasicLetterCaptchaOptions> options = null)
        {
            var option = new BasicLetterCaptchaOptions
            {
                Letters     = "2346789ABCDEFGHJKLMNPRTUVWXYZ",
                SessionName = "CaptchaCode",
                CodeLength  = 4
            };

            options?.Invoke(option);

            services.AddTransient <ISessionBasedCaptcha>(sb => new BasicLetterCaptcha(option));
        }
Exemplo n.º 2
0
 public BasicLetterCaptcha(BasicLetterCaptchaOptions options)
 {
     Options  = options;
     _options = options;
 }