當我運行我的下載文件的方法時,它不會等待下載完成,然後再調用下一個方法「unzipfiles」,我怎麼才能讓它等到下載文件?用C下載文件#
private void Download_Click(object sender, EventArgs e)
{
WebClient webClient = new WebClient();
webClient.DownloadFileCompleted += new AsyncCompletedEventHandler(Completed);
webClient.DownloadProgressChanged += new DownloadProgressChangedEventHandler(ProgressChanged);
webClient.DownloadFileAsync(new Uri("http://download1us.softpedia.com/dl/f4932a906a7dd98c7ff002b07e9bd94b/4e065004/100079174/software/portable/security/ccsetup307.zip"), @"ccsetup307.zip");
// Call unzip method
unzipfiles();
}