-
Notifications
You must be signed in to change notification settings - Fork 27
Expand file tree
/
Copy pathKeyCaptchaExample.cs
More file actions
31 lines (28 loc) · 963 Bytes
/
KeyCaptchaExample.cs
File metadata and controls
31 lines (28 loc) · 963 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 KeyCaptchaExample
{
public KeyCaptchaExample(string apiKey)
{
TwoCaptcha solver = new TwoCaptcha(apiKey);
KeyCaptcha captcha = new KeyCaptcha();
captcha.SetUserId(184015);
captcha.SetSessionId("9ff29e0176e78eb7ba59314f92dbac1b");
captcha.SetWebServerSign("964635241a3e5e76980f2572e5f63452");
captcha.SetWebServerSign2("3ca802a38ffc5831fa293ac2819b1204");
captcha.SetUrl("https://2captcha.com/demo/keycaptcha");
try
{
solver.Solve(captcha).Wait();
Console.WriteLine("Captcha solved: " + captcha.Code);
}
catch (AggregateException e)
{
Console.WriteLine("Error occurred: " + e.InnerExceptions.First().Message);
}
}
}
}