Friday, 5 December 2014

Recaptcha timeout issue solved

  protected bool GetCaptchaResponse()
        {
            bool isValidResponse = false;
            // Getting Proxy for Recaptcha
            if (Settings.GetSetting("webProxy") != null)
            {
                string proxyAdress = Settings.GetSetting("webProxy");
                if (!string.IsNullOrEmpty(proxyAdress))
                {
                    WebProxy webproxy = new WebProxy(proxyAdress);
                    recaptcha.Proxy = webproxy;
                }
            }

            Page.Validate();
            var IsValid = recaptcha.IsValid;
            var valid = Page.IsValid;

            if (IsValid && valid)
            {
                isValidResponse = true;
            }
            else
            {
                isValidResponse = false;
                lblResult.ForeColor = System.Drawing.Color.Red;
                lblResult.Text = "Verification words are incorrect.";
            }
            return isValidResponse;
        }

No comments:

Post a Comment

Featured post

Getting Started With SOLR

Getting Started with Solr ·           Features o    Hit highlighting o    Auto correction o    Faceted Search o    Multi lan...