I have to download three .exe files of 7-Zip displaying the download percentage. I created a method according to this article but the "DownloadProgressInProgress" and "DownloadFileComplete" events do not occur.
static void Main(string[] args)
{
string[] listUri = { "https://www.7-zip.org/a/7z1900.exe", "https://www.7-zip.org/a/7z1900.exe", "https://www.7-zip.org/a/7z1900.exe" };
for (int a = 0; a < listUri.Length; a++)
{
WebClient myWebClient = new WebClient();
myWebClient.DownloadFileCompleted += new AsyncCompletedEventHandler(DownloadFileComplete);
myWebClient.DownloadProgressChanged += new DownloadProgressChangedEventHandler(DownloadProgressInProgress);
myWebClient.DownloadFileAsync(new Uri(listUri[a]), @"C:\\Users\\Luca\\Desktop\\DownloadZip" + (a + 1).ToString() + ".exe");
}
}
private static void DownloadProgressInProgress(object sender, DownloadProgressChangedEventArgs e)
{
throw new NotImplementedException();
}
private static void DownloadFileComplete(object sender, AsyncCompletedEventArgs e)
{
throw new NotImplementedException();
}
How can I do to use the two events by downloading the file list?
Thanks in advance!