Lol, how did you get that console?
Oh and, I can't use 'keep-alive", it gave me an error:
"Keep-Alive and Close can't be inherited with this property.
parameter name: value"
(translated from dutch)
Code:
Dim myWebReq As HttpWebRequest
Dim myWebResp As HttpWebResponse
Dim encoding As New System.Text.ASCIIEncoding()
Dim data() As Byte
Dim sr As StreamReader
Dim sw As StreamWriter
Dim postData As String = "username=Username&user_password=UserPass&op=login"
data = encoding.ASCII.GetBytes(postData)
myWebReq = WebRequest.Create("http://productions.lostpirates.co.uk/")
myWebReq.Accept = "Text/Html,application/xhtml+xml"
myWebReq.Method = "POST"
myWebReq.ContentLength = data.Length
myWebReq.UserAgent = "Mozilla/5.0"
myWebReq.Connection = "keep-alive"
myWebReq.KeepAlive = 300
myWebReq.Referer = "http://productions.lostpirates.co.uk/"
Dim myStream As Stream = myWebReq.GetRequestStream()
myStream.Write(data, 0, data.Length)
myStream.Close()
myWebResp = myWebReq.GetResponse
sr = New StreamReader(myWebResp.GetResponseStream)
Dim strHTML As String = sr.ReadToEnd
sw = File.CreateText(My.Computer.FileSystem.SpecialDirectories.Desktop & "\test.htm")
sw.WriteLine(strHTML)
sw.Close()
What should I do?