Example #1
0
        public CheckCodeOutput Check(GeetestCheckInput input)
        {
            GeetestLib geetest = GetGeetestLib();
            int        result  = geetest.enhencedValidateRequest(input.Challenge, input.Validate, input.Seccode);

            if (result == 1)
            {
                var verifcationCache = new VerifcationCache()
                {
                    VerifcationType = VerifcationType.Geetest,
                    Code            = Guid.NewGuid().ToString()
                };
                SetCache(verifcationCache);
                return(new CheckCodeOutput()
                {
                    Success = true,
                    Token = verifcationCache.Code
                });
            }
            else
            {
                return(new CheckCodeOutput()
                {
                    Success = false
                });
            }
        }
Example #2
0
        public string GetCaptcha()
        {
            var verifcationCache = new VerifcationCache()
            {
                VerifcationType = VerifcationType.GeetestNow
            };

            SetCache(verifcationCache);

            GeetestLib geetest        = GetGeetestLib();
            Byte       gtServerStatus = geetest.preProcess();

            return(geetest.getResponseStr());
        }