예제 #1
0
        public async Task TestAllOptions()
        {
            GeeTest captcha = new GeeTest();

            captcha.SetGt("f2ae6cadcf7886856696502e1d55e00c");
            captcha.SetApiServer("api-na.geetest.com");
            captcha.SetChallenge("69A21A01-CC7B-B9C6-0F9A-E7FA06677FFC");
            captcha.SetUrl("https://launches.endclothing.com/distil_r_captcha.html");

            var parameters = new Dictionary <string, string>();

            parameters["method"]     = "geetest";
            parameters["gt"]         = "f2ae6cadcf7886856696502e1d55e00c";
            parameters["api_server"] = "api-na.geetest.com";
            parameters["challenge"]  = "69A21A01-CC7B-B9C6-0F9A-E7FA06677FFC";
            parameters["pageurl"]    = "https://launches.endclothing.com/distil_r_captcha.html";

            await CheckIfCorrectParamsSendAndResultReturned(captcha, parameters);
        }
예제 #2
0
        public void Main()
        {
            TwoCaptcha solver = new TwoCaptcha("YOUR_API_KEY");

            GeeTest captcha = new GeeTest();

            captcha.SetGt("f2ae6cadcf7886856696502e1d55e00c");
            captcha.SetApiServer("api-na.geetest.com");
            captcha.SetChallenge("12345678abc90123d45678ef90123a456b");
            captcha.SetUrl("https://mysite.com/captcha.html");

            try
            {
                solver.Solve(captcha).Wait();
                Console.WriteLine("Captcha solved: " + captcha.Code);
            }
            catch (AggregateException e)
            {
                Console.WriteLine("Error occurred: " + e.InnerExceptions.First().Message);
            }
        }