Downloading WebPage

Faith
08-04-2004, 07:36 AM
Hioy!

How would I be able to download a webpage to my computer (.html,.htm) using only the address and with Visual Basic.net?

Thx :)

PWNettle
08-04-2004, 10:51 AM
...by using the WebClient object of the System.Net namespace:

Dim oWebclient As new System.Net.WebClient
Dim oStream As System.IO.StreamReader
Dim sHtml As String

' Change URL here to whatever...
oStream = new StreamReader(oWebClient.OpenRead("http://www.google.com"))

sHtml = oStream.ReadToEnd().ToString()

MessageBox.Show(sHtml)

Paul

Faith
08-06-2004, 04:56 PM
Thank you very much :)

RealityRipple
08-22-2004, 01:46 PM
shouldn't it be
oStream = New IO.StreamReader(oWebClient.OpenRead("http://www.google.com"))

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum