I am using this to download a file and get % info and completed info. I want to know how to get the size of the file being downloaded and the URL remote address and the local address where the file is being saved to.
private void Form1_Load_1(object sender, EventArgs e)
{
label21.Text = "Download in progress...";
WebClient webClient = new WebClient();
webClient.DownloadFileCompleted += new AsyncCompletedEventHandler(Completed);
webClient.DownloadProgressChanged += new DownloadProgressChangedEventHandler(ProgressChanged);
webClient.DownloadFileAsync(new Uri("http://www.somesite.com/Update/Updates.zip.010"), @"Updates.zip.010");
}
private void ProgressChanged(object sender, DownloadProgressChangedEventArgs e)
{
progressBar1.Value = e.ProgressPercentage; //Progress Bar Handler
label1.Visible = true;
label1.Text = progressBar1.Value.ToString() + " %"; //Adds percent to a label
}
private void Completed(object sender, AsyncCompletedEventArgs e)
{
label11.Visible = true;
label11.Text = "Done";
}