I have a small application that downloads some files from a remote (HTTP) server to the user's local hard drive, some of the files are large, but I don’t know how large they are at runtime. Is there any method that will allow me to upload a file with some type of progress bar?
This is a WinForms application, I am currently using WebClient.DownloadFile () to upload a file.
Edit: I looked at the DownloadProgressChanged and OnDownloadProgressChanged events, and they seem to work fine, but they won't work for my solution. I upload several files, and if I use WebClient.DownloadFileAsync, then the event is fired several times per second, because each file calls it.
Here is the basic structure of the application:
- Download a list of files, usually around 114
- Run a loop over the list of files and load each one in its absence
I am not opposed to downloading each file separately, but without downloading it using DownloadFileAsync () I cannot use event handlers.
source
share