Save a web page to a file : WebClient « Socket Network « VB.Net Tutorial






Imports System.Net
Imports System.IO
Imports System.Text


Public Class Tester
    Public Shared Sub Main
        Dim myWebClient As New WebClient()
        Dim mybyte() As Byte

        mybyte = myWebClient.DownloadData("http://www.java2s.com")
        myWebClient.DownloadFile("http://www.java2s.com", "test.txt")


    End Sub
End Class








22.29.WebClient
22.29.1.Save a web page to a file
22.29.2.Create a StreamReader from a WebClient