Advertisement
Guest User

AZcaptcha C# recaptcha v2 resolver code

a guest
Sep 10th, 2018
1,257
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. public string SendRecaptchav2Request()
  2.         {
  3.             //POST
  4.             try
  5.             {
  6.                 System.Net.ServicePointManager.Expect100Continue = false;
  7.                 var request = (HttpWebRequest)WebRequest.Create("http://azcaptcha.com/in.php");
  8.  
  9.                 var postData = "key=AZcaptcha_API_KEY&method=userrecaptcha&googlekey=GOOGLE_KEY";//&pageurl=yourpageurl"; ;
  10.                 var data = Encoding.ASCII.GetBytes(postData);
  11.  
  12.                 request.Method = "POST";
  13.  
  14.                 request.ContentType = "application/x-www-form-urlencoded";
  15.                 request.ContentLength = data.Length;
  16.  
  17.                 using (var stream = request.GetRequestStream())
  18.                 {
  19.                     stream.Write(data, 0, data.Length);
  20.                 }
  21.  
  22.                 var response = (HttpWebResponse)request.GetResponse();
  23.  
  24.                 var responseString = new StreamReader(response.GetResponseStream()).ReadToEnd();
  25.  
  26.                 //  GET
  27.                 if (responseString.Contains("OK|"))
  28.                 {
  29.                     return responseString.Substring(0, 3);
  30.                 }
  31.                 else
  32.                 {
  33.                     return "Error";
  34.                 }
  35.             }
  36.             catch (Exception e)
  37.             {
  38.                 string tt = e.Message;
  39.                 return tt;
  40.             }
  41.  
  42.         }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement