Author

Topic: [$2 Bounty]. Working with C# and webheaders (Read 246 times)

sr. member
Activity: 448
Merit: 251
December 29, 2015, 01:28:40 PM
#1
Me and my partner are launching a website which will be similar to TBN except only specific Bitcoin and Cryptocurrency. I will offer $2 to the person who can help me solve this problem, as well as the "400 Bad Request" error I keep running into. Below is the Fiddler error I keep getting
Quote
The pre-check and post-check tokens are meaningless when Cache-Control: No Cache is specified
The thing is I thought I enabled caching
Here's my code
Code:
  public void GetReCaptcha(string url, string siteKey, string addName, string recaptchaframe_url)
        {
          // 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);
        }
Jump to: