Example #1
0
 /// <summary>
 /// Method to generate captcha
 /// </summary>
 public void GenerateCaptcha()
 {
     try
     {
         CaptchaHandler.GenerateCaptcha(200, 40, 5);
     }
     catch (Exception ex)
     {
         throw;
     };
 }
Example #2
0
        public override string GetVaryByCustomString(HttpContext context, string custom)
        {
            var key = CaptchaHandler.GetVaryByCustomString(context, custom);

            if (key != null)
            {
                return(key);
            }

            var secure = Request.IsSchemeHttps() && custom.In(VaryByCustomNames.VaryByScheme)
                ? "s" : null;

            var user = custom.In(VaryByCustomNames.VaryByUser)
                ? string.Concat(custom, context.User.Identity.Name) : null;

            return(string.Concat(secure, user));
        }