Thanks lot i got it to report progress but how would i go about getting the download speed and getting the amount that has been correctly downloaded? This is where my code is ATM, it downloads all files from the list and returns progress in the progbar:
vb.net Code:
Imports System.IO
Imports System.Net
Public Class Form1
Private Const filenames As String = "c:\Users\Home\Desktop\list_of_files.txt"
Private Const url As String = "http://www.fileden.com/files/2008/12/22/2233952"
Private Const savepath As String = "c:\Users\Home\Desktop"
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Try
Dim sr As New IO.StreamReader(filenames)
Dim line As String = sr.ReadLine()
Dim req As Net.WebRequest
Dim resp As IO.Stream
Dim out As IO.BinaryWriter
Dim URLRes As Net.HttpWebResponse
Dim iBytesRead As Integer
Do While line IsNot Nothing
req = Net.HttpWebRequest.Create(url & line)
resp = req.GetResponse().GetResponseStream()
URLRes = req.GetResponse
pprogress.Maximum = URLRes.ContentLength
out = New IO.BinaryWriter(New IO.FileStream(savepath & line, IO.FileMode.OpenOrCreate))
Dim buf(4096) As Byte
Dim k As Int32 = resp.Read(buf, 0, 4096)
iBytesRead = resp.Read(buf, 0, 4096)
Do While k > 0
out.Write(buf, 0, k)
k = resp.Read(buf, 0, 4096)
If pprogress.Value + iBytesRead <= pprogress.Maximum Then
pprogress.Value += iBytesRead
Else
pprogress.Value = pprogress.Maximum
End If
Loop
resp.Close()
out.Close()
line = sr.ReadLine()
Loop
Catch dlerror As Exception
MsgBox(dlerror.Message)
End Try
End Sub
End Class