' Collection of code snippets by Arne Vajhøj ' posted to eksperten.dk, usenet and other places (2002-now) Imports System Imports System.IO Imports System.Net Imports System.Text Class MainClass Public Shared Sub Main(ByVal args As String()) Dim req As HttpWebRequest = CType(WebRequest.Create("http://www.microsoft.com/"), HttpWebRequest) Dim resp As HttpWebResponse = CType(req.GetResponse, HttpWebResponse) Dim instm As Stream = resp.GetResponseStream Dim outstm As Stream = New FileStream("C:\ms.html", FileMode.CreateNew, FileAccess.Write) Dim b(1000) As Byte Dim n As Integer n = instm.Read(b, 0, b.Length) While (n > 0) outstm.Write(b, 0, n) n = instm.Read(b, 0, b.Length) End While outstm.Close instm.Close resp.Close End Sub End Class