here is a tutorial for getting reCaptcha image into a picture box.
Ok lets get to the point of getting reCaptcha image.
1. first download the page using httpwebrequest
2. then parse the reCaptcha url
3. goto that challenge url and you'll find the actual "key" for that image
4. parse that key and goto http://www.google.com/recaptcha/api/image?c=PARSED_KEY to get the image
This code is fragmented so may not work by just copying and pasting...
I wrote this while making Pligg submitter bot which isnt complete. You can help me if you can here
Ok lets get to the point of getting reCaptcha image.
1. first download the page using httpwebrequest
2. then parse the reCaptcha url
3. goto that challenge url and you'll find the actual "key" for that image
4. parse that key and goto http://www.google.com/recaptcha/api/image?c=PARSED_KEY to get the image
Code
Dim request As HttpWebRequest = HttpWebRequest.Create("www.pagewithcaptcha.com")
Dim response as HttpWebResponse
response = CType(request.GetResponse, HttpWebResponse)
Dim webstream As Stream = response.GetResponseStream
Dim streamreader As New StreamReader(webstream, Encoding.UTF8)
Dim html As String = streamreader.ReadToEnd
'Now we have the source of the page lets parse and get the challenge url
Dim web As IHTMLDocument2 = New HTMLDocumentClass()
web.write(html)
web.close()
Dim allElements As IHTMLElementCollection = web.body.all
Dim allInputs As IHTMLElementCollection = allElements.tags("script")
Dim element As IHTMLElement
Dim challengeUrl As String = ""
Dim tagName As String = ""
For Each element In allScript
tagName = element.getAttribute("src")
If (Not tagName = Nothing) Then
If (tagName.Contains("http://api.recaptcha.net/")) Then
challengeUrl = tagName
Exit For
End If
End If
Next
'Now we have the challenge url in challengeUrl variable, so lets "GET" it
Dim request1 As HttpWebRequest = HttpWebRequest.Create(challengeUrl)
Dim response1 as HttpWebResponse
response1 = CType(request1.GetResponse, HttpWebResponse)
Dim webstream As Stream = response1.GetResponseStream
Dim streamreader As New StreamReader(webstream, Encoding.UTF8)
Dim temp As String = streamreader.ReadToEnd
'Now parse the index or whatever of that image, it is the thing that we are looking after
Dim startPos As Integer = temp.IndexOf("challenge : '")
startPos += 13
temp = temp.Substring(startPos)
Dim endPos As Integer = temp.IndexOf("'")
temp = (temp.Substring(0, endPos))
'Now the temp variabloe contains the key for the image.. You can download the image from
"http://www.google.com/recaptcha/api/image?c=" & tempThis code is fragmented so may not work by just copying and pasting...
I wrote this while making Pligg submitter bot which isnt complete. You can help me if you can here

