url auslesen
Eine URL auslesen:
Imports System.Net
Imports System.IO
Module UrlLesen
Sub main()
Console.Write(GetHTMLPage("http://www.dreamcodes.de"))
Console.ReadLine()
End Sub
Public Function GetHTMLPage(ByVal URL As String) As String
Dim Seite As String
Dim Http As HttpWebRequest
Dim Response As WebResponse
Dim Request As WebRequest
Request = System.Net.HttpWebRequest.Create(URL)
Request.Method = "GET"
Request.Timeout = 120000
Response = Request.GetResponse
Dim sr As System.IO.StreamReader = _
New System.IO.StreamReader( _
Response.GetResponseStream(), _
True)
Seite = sr.ReadToEnd()
sr.Close()
Response.Close()
Return Seite
End Function
End Module
|