Example #1
0
        private static bool BackValidate(string geetestChallenge, string geetestValidate, string geetestSeccode)
        {
            if (!string.IsNullOrEmpty(geetestChallenge) && !string.IsNullOrEmpty(geetestValidate) &&
                !string.IsNullOrEmpty(geetestSeccode))
            {
                const string privateKey = "91f6e4142cf97fa261c8decc1be5c2fd";
                var          geetest    = new GeetestLib(privateKey);

                var result = geetest.validate(geetestChallenge, geetestValidate, geetestSeccode);

                return(result);
            }
            return(false);
        }
        protected void submitBtn_Click(object sender, EventArgs e)
        {
            String     privateKey = "0f1a37e33c9ed10dd2e133fe2ae9c459";
            GeetestLib geetest    = new GeetestLib(privateKey);
            Boolean    result     = geetest.validate(Request);

            if (result)
            {
                //验证正确后的操作
                Response.Write("ok");
            }
            else
            {
                //验证错误后的操作
                Response.Write("error");
            }
        }