[VB] HTTP WEB REQUEST SPAMBOG.Com

02/06/2012 14:59 roteisenklinge#1
Alles geklääääärt;) danke!
02/06/2012 15:37 Kraizy​#2
PHP Code:
//Login
With New Http
            Dim sb 
As New StringBuilder
            sb
.Append("siteFrom=0")
            
sb.Append("&strLoginAlias=test123")
            
sb.Append("&intLoginDomainId=1")
            
sb.Append("&strLoginPassword=")
            
sb.Append("&btnLogin=Postfach+abrufen")
            
sb.Append("&strGeneratedAddress=test123%40spambog.com")

            
Dim html As String = .GetResponse("http://www.spambog.com/inbox.htm", sb.ToString)
        
End With

//Http Klasse
Public Class Http
    Dim cookieCon 
As New CookieContainer
    Dim request 
As HttpWebRequest
    Dim response 
As HttpWebResponse

    
Public Function GetResponse(ByVal url As String) As String
        request 
= CType(HttpWebRequest.Create(url), HttpWebRequest)
        
request.CookieContainer = cookieCon
        response 
= CType(request.GetResponse(), HttpWebResponse)

        Return New 
StreamReader(response.GetResponseStream()).ReadToEnd()
    
End Function

    Public Function 
GetResponse(ByVal url As String, ByVal post As String) As String
        request 
= CType(HttpWebRequest.Create(url), HttpWebRequest)
        
request.Method = "POST"
        
request.CookieContainer = cookieCon
        request
.UserAgent = "Mozilla/5.0 (Windows NT 6.1; rv:8.0) Gecko/20100101 Firefox/8.0"
        
request.ContentType = "application/x-www-form-urlencoded"

        
Dim byteArr() As Byte = Encoding.UTF8.GetBytes(post)
        
request.ContentLength = byteArr.Length

        Dim dataStream 
As Stream = request.GetRequestStream()
        
dataStream.Write(byteArr, 0, byteArr.Length)

        
response = CType(request.GetResponse(), HttpWebResponse)

        Return New 
StreamReader(response.GetResponseStream()).ReadToEnd()
    
End Function
End Class
//http://www.elitepvpers.com/forum/coding-tutorials/1575469-vb-net-httpwebrequest-tutorial.html 
In der "html"-Variable ist nun der gesamte Quelltext, also mit den Emails bzw. Links zu den Emails usw.
02/06/2012 16:24 roteisenklinge#3
Hey, super du hast mir soweit geholfen;) Jetzt fehlt nur noch das Email auslesen;)
02/06/2012 18:55 Kraizy​#4
Split/SubString oder RegEx (wäre wohl geeigneter).