Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public string SendRecaptchav2Request()
- {
- //POST
- try
- {
- System.Net.ServicePointManager.Expect100Continue = false;
- var request = (HttpWebRequest)WebRequest.Create("http://2captcha.com/in.php");
- var postData = "key=2captcha API KEY&method=userrecaptcha&googlekey=GOOGLE KEY";//&pageurl=yourpageurl"; ;
- var data = Encoding.ASCII.GetBytes(postData);
- request.Method = "POST";
- request.ContentType = "application/x-www-form-urlencoded";
- request.ContentLength = data.Length;
- using (var stream = request.GetRequestStream())
- {
- stream.Write(data, 0, data.Length);
- }
- var response = (HttpWebResponse)request.GetResponse();
- var responseString = new StreamReader(response.GetResponseStream()).ReadToEnd();
- // GET
- if (responseString.Contains("OK|"))
- {
- return responseString.Substring(0, 3);
- }
- else
- {
- return "Error";
- }
- }
- catch (Exception e)
- {
- string tt = e.Message;
- return tt;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement