-
Notifications
You must be signed in to change notification settings - Fork 27
Expand file tree
/
Copy pathGeeTestOptionsExample.cs
More file actions
31 lines (28 loc) · 965 Bytes
/
GeeTestOptionsExample.cs
File metadata and controls
31 lines (28 loc) · 965 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
using System;
using System.Linq;
using TwoCaptcha.Captcha;
namespace TwoCaptcha.Examples
{
public class GeeTestOptionsExample
{
public GeeTestOptionsExample(string apiKey)
{
TwoCaptcha solver = new TwoCaptcha(apiKey);
GeeTest captcha = new GeeTest();
captcha.SetGt("f2ae6cadcf7886856696502e1d55e00c");
captcha.SetApiServer("api.geetest.com");
captcha.SetChallenge("12345678abc90123d45678ef90123a456b");
captcha.SetUrl("https://2captcha.com/demo/geetest");
captcha.SetProxy("HTTPS", "login:password@IP_address:PORT");
try
{
solver.Solve(captcha).Wait();
Console.WriteLine("Captcha solved: " + captcha.Code);
}
catch (AggregateException e)
{
Console.WriteLine("Error occurred: " + e.InnerExceptions.First().Message);
}
}
}
}