Marcoluca56
Newbie
- Apr 1, 2014
- 24
- 0
Hi guys!
I am looking for a way that allow me to show captcha in a picturebox or in other way, with Webrequest, so WITHOUT Webbrowser.
This is my code:
Thanks in advance ^_^
I am looking for a way that allow me to show captcha in a picturebox or in other way, with Webrequest, so WITHOUT Webbrowser.
This is my code:
Code:
Dim logincookie As CookieContainer
Dim postData As String = "......"
Dim tempCookies As New CookieContainer
Dim encoding As New UTF8Encoding
Dim byteData As Byte() = encoding.GetBytes(postData)
Dim postReq As HttpWebRequest = DirectCast(WebRequest.Create("....."), HttpWebRequest)
postReq.Method = "POST"
postReq.KeepAlive = True
postReq.CookieContainer = tempCookies
postReq.ContentType = "application/x-www-form-urlencoded"
postReq.Referer = "....."
postReq.UserAgent = "Mozilla/5.0 (Windows; U; Windows NT 6.1; ru; rv:1.9.2.3) Gecko/20100401 Firefox/4.0 (.NET CLR 3.5.30729)"
postReq.ContentLength = byteData.Length
Dim postreqstream As Stream = postReq.GetRequestStream()
postreqstream.Write(byteData, 0, byteData.Length)
postreqstream.Close()
Dim postresponse As HttpWebResponse
postresponse = DirectCast(postReq.GetResponse(), HttpWebResponse)
tempCookies.Add(postresponse.Cookies)
logincookie = tempCookies
Thanks in advance ^_^