Here's my code
{
// get pageHtml
WebBrowser wb = new WebBrowser();
wb.ScrollBarsEnabled = false;
wb.ScriptErrorsSuppressed = true;
wb.Navigate("http://oneadfaucet.com/googlebibi.php?st=1");
while (wb.ReadyState != WebBrowserReadyState.Complete)
{
Application.DoEvents();
}
Uri googleurl = new Uri("http://oneadfaucet.com/googlebibi.php?st=1");
cookieJar.SetCookies(googleurl, wb.Document.Cookie);
string pageHtml = get(recaptchaframe_url);
try
{
string challengeimageurl = GetBetween(pageHtml, " HttpWebRequest request = (HttpWebRequest)WebRequest.Create(challengeimageurl);
request.Referer = recaptchaframe_url;
request.Accept = "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8";
request.Headers.Add(HttpRequestHeader.AcceptEncoding, "gzip,deflate");
request.Headers.Add(HttpRequestHeader.AcceptLanguage, "en-us;en;q=0.5");
request.UserAgent = "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 1.1.4322; .NET CLR 2.0.50727)";
request.CookieContainer = this.cookieJar;
WebResponse response = request.GetResponse();
Stream recaptcha_stream = response.GetResponseStream();
response_headers = response.Headers;
Form1.DefaultInstance.picCaptcha.Image = Image.FromStream(recaptcha_stream);
Form1.DefaultInstance.picCaptcha.Refresh();
}
catch (WebException exception)
{
MessageBox.Show("The program was unable to download the CAPTCHA: " + exception.Message);
}
//update captcha image
// wait for captcha image click
while (Form1.DefaultInstance.waitForClickCap)
{
Application.DoEvents();
}
// loop through responses and add to request data
string recaptcharesponse = null;
foreach (string capresponse in Microsoft.VisualBasic.Strings.Split(Form1.DefaultInstance.txtCaptcha.Text, ", ", -1, Microsoft.VisualBasic.CompareMethod.Binary))
{
// add each selected images to the checked boxes.
recaptcharesponse = recaptcharesponse + "fbc-imageselect-checkbox-" + capresponse;
}
pageHtml = post(url, url, "address=" + Form1.DefaultInstance.txtAdd.Text + "&honeypot=checked&" + addName + "=" + addName + "&" + recaptcharesponse);
}