private void DoDownload()
{
Uri fileUrl = new Uri("http://www.codeproject.com" +
"/info/stuff/cp_bg_black1024.gif");
string tempPath = Path.GetTempPath();
string fileName = Path.GetFileName(fileUrl.AbsoluteUri);
string downloadPath = Path.Combine(tempPath, fileName);
FileDownloader downloader = new FileDownloader();
downloader.Proxy = WebRequest.DefaultWebProxy;
downloader.Credentials = CredentialCache.DefaultCredentials;
downloader.DownloadCompleted += new
EventHandler(OnDownloadCompleted);
downloader.DownloadProgressChanged += new
EventHandler(
OnDownloadProgressChanged);
downloader.DownloadStatusChanged += new
EventHandler(
OnDownloadStatusChanged);
downloader.Download(fileUrl, tempPath);
}