ich habe leider folgendes Problem:
Ich möchte von dem Spam Email Anbieter "yopmail.com" meine Emails auslesen.
Dazu muss ich mich auf der Webseite einfach mit "test" Anmelden
Hierzu der HTTP Header : Siehe Anhang
accname = Account Name im Beispiel "test"
Code:
Dim postData As String = "yp=CAGRmBQZlZmR2BQp4ZwR4&login=" & accname.Text
Dim tempCookies As New CookieContainer
Dim encoding As New UTF8Encoding
Dim byteData As Byte() = encoding.GetBytes(postData)
Dim postReq As HttpWebRequest = DirectCast(WebRequest.Create("http://www.yopmail.com/en"), HttpWebRequest)
postReq.Method = "POST"
postReq.KeepAlive = True
postReq.CookieContainer = tempCookies
postReq.ContentType = "application/x-www-form-urlencoded"
postReq.Referer = "http://www.yomail.com"
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)
cookies = tempCookies
Dim postreqreader As New StreamReader(postresponse.GetResponseStream())
Dim thepage As String = postreqreader.ReadToEnd
Dim sra As New StreamWriter("test.html")
sra.Write(thepage)
sra.Close()
Irgendwie führt er die HttpWebrequest nicht aus.
Hoffe ihr könnt mir helfen.






