Request = System.Net.WebRequest.Create(sURL)
Response = Request.GetResponse
ResponseStream = Response.GetResponseStream
Dim numBytesToRead As Integer = CInt(Response.ContentLength)
Dim bytes(Response.ContentLength) As Byte
Dim numBytesRead As Integer = 0
While numBytesToRead + 1 > 0
Dim n As Integer = ResponseStream.Read(bytes, numBytesRead, numBytesToRead)
If n = 0 Then
Exit While
End If
numBytesRead += n
numBytesToRead -= n
End While
|