-
Notifications
You must be signed in to change notification settings - Fork 27
Expand file tree
/
Copy pathCapyOptionsExample.cs
More file actions
30 lines (27 loc) · 897 Bytes
/
CapyOptionsExample.cs
File metadata and controls
30 lines (27 loc) · 897 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
using System;
using System.Linq;
using TwoCaptcha.Captcha;
namespace TwoCaptcha.Examples
{
public class CapyOptionsExample
{
public CapyOptionsExample(string apiKey)
{
TwoCaptcha solver = new TwoCaptcha(apiKey);
Capy captcha = new Capy();
captcha.SetSiteKey("PUZZLE_Abc1dEFghIJKLM2no34P56q7rStu8v");
captcha.SetUrl("https://www.mysite.com/captcha/");
captcha.SetApiServer("https://jp.api.capy.me/");
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);
}
}
}
}