Download Progress Indicator Technology Sample
This sample shows how to display the progress of a file download.
For information about using the samples, see the following topics:
To build the sample using the command prompt
Open a Command Prompt window and navigate to one of the language-specific subdirectories under the WebClientProgress directory. For information about required settings and the SDK Command Prompt, see How to: Set Sample Settings.
Type msbuild WebClientProgressCS.sln or msbuild WebClientProgressVB.sln, depending on your choice of programming language, at the command line.
To build the sample using Visual Studio
Open Windows Explorer and navigate to one of the language-specific subdirectories under the WebClientProgress directory.
Double-click the icon for the WebClientProgressCS.sln or WebClientProgressVB.sln file, depending on your choice of programming language, to open the file in Visual Studio.
On the Build menu, click Build Solution.
The application is built in the default \bin or \bin\Debug directory.
To run the sample
Navigate to the directory that contains the new executable, using the command prompt or Windows Explorer.
Type WebClientProgress at the command line, or double-click the icon for WebClientProgress to launch it from Windows Explorer.
The sample form uses its client_DownloadProgressChanged method to handle the DownloadProgressChanged event. An event-handling method's second parameter must be of type EventArgs or a derived type. In this case, the DownloadProgressChangedEventArgs type exposes a ProgressPercentage property, whose value is assigned to the Value property. Likewise, the form handles the DownloadFileCompleted event with its client_DownloadFileCompleted method, which takes as its second parameter an instance of type AsyncCompletedEventArgs.