Hi all,
Need some help from you ppl. I want to develope a downloader program, where I can queue number of files to be downloaded from the web. I have got a following function, which I use to download individual file from the web:
VB Code:
Public Function DownloadFile(ByVal URL As String, ByVal LocalFileName As String) As Boolean Dim myClient As New System.Net.WebClient Dim S As System.IO.FileStream Dim myBuffer As Byte() Try myBuffer = myClient.DownloadData(URL) S = New IO.FileStream(LocalFileName, IO.FileMode.OpenOrCreate) S.Write(myBuffer, 0, myBuffer.Length) S.Flush() Catch Finally If Not S Is Nothing Then S.Close() myClient.Dispose() End Try If Not myBuffer Is Nothing Then Return True End Function
This function is working fine, but the problem with using this function for multiple downloads are:
1. I cannot terminate the downloading process inbetween.
2. Cant show a progress bar while downloading.
3. There are various URLs which have asp or php path, wherein giving a destination path is troublesome.
Pls pass on your suggestions and ideas.
Cheers n Regards




Reply With Quote