download file
C# Download File with Progress Bar
Submitted by Ben Hodson on Sun, 10/19/2008 - 20:06
The following is a snippet of code to download a file in a Windows Forms application using C# and the System.Net.WebClient object. This code also updates a progress bar as the file is downloaded.
First, create a new windows forms application with C# as the target language. (NOTE: This works in any .NET framework version). Add a ProgressBar to the form and a BackgroundWorker control. Also add a Button to the form. The form will look something like this:


Recent comments
14 hours 13 min ago
1 day 14 hours ago
3 days 15 hours ago
4 days 4 hours ago
4 days 15 hours ago
4 days 21 hours ago
5 days 56 min ago
1 week 21 hours ago
1 week 1 day ago
1 week 4 days ago