public static void MarkRequestEx(this AntiBot antiBot, string text)
 {
     if (text != LOAD_MODEL_DUMMY_TEXT)
     {
         antiBot.MarkRequest();
     }
 }
Example #2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            Thread.Sleep(1000);

            _AntiBot = this.Context.ToAntiBot();
            if (_AntiBot.IsRequestValid())
            {
                Response.Redirect(ALLOW_CONTINUE_PAGE_URL, true);
            }
        }
        public static AntiBot ToAntiBot(this HttpContext httpContext)
        {
            var config = new AntiBotConfig()
            {
                HttpContext    = httpContext,
                CaptchaPageUrl = CAPTCHA_PAGE_URL,
                SameIpBannedIntervalInSeconds  = Config.SAME_IP_BANNED_INTERVAL_IN_SECONDS,
                SameIpIntervalRequestInSeconds = Config.SAME_IP_INTERVAL_REQUEST_IN_SECONDS,
                SameIpMaxRequestInInterval     = Config.SAME_IP_MAX_REQUEST_IN_INTERVAL,
            };
            var antiBot = new AntiBot(config);

            return(antiBot);
        }