Hur man laddar ner HTML med VB.net

Hur man laddar ner HTML med VB.net:

Imports System.Net
Imports System.IO

Module Module1

    Public Function ScreenScrapeHtml(ByVal url As String) As String

        Dim objRequest As WebRequest = System.Net.HttpWebRequest.Create(url)
        Dim sr As New StreamReader(objRequest.GetResponse().GetResponseStream())
        Dim result As String = sr.ReadToEnd()
        sr.Close()

        Return result

    End Function

End Module

Användning:
TextBox.Text = ScreenScrapeHtml(“http://www.expressen.se”)