在这种情况下,我该如何使用进度条?
void Client_DownloadFileCompleted(object sender, AsyncCompletedEventArgs e)
{
//System.Windows.MessageBox.Show("Update Complete!", "Message", MessageBoxButton.OK, MessageBoxImage.Information);
Uri uri = new Uri(url);
string filename = System.IO.Path.GetFileName(uri.AbsolutePath);
ZipFile.ExtractToDirectory(filePathDir + "/" + filename, filePathDir);
}
编辑: @Alessandro D'Andria , 但在这种情况下呢?
WebClient wc = new WebClient();
Stream zipReadingStream = wc.OpenRead(url);
ZipArchive zip = new ZipArchive(zipReadingStream);
ZipFileExtensions.ExtractToDirectory(zip, filePathDir);
DownloadProgressChanged
事件:https://msdn.microsoft.com/zh-cn/library/system.net.webclient.downloadprogresschanged(v=vs.110).aspx - ThePerplexedOneSystem.IO.Compression
中的默认实现手动提取每个文件并跟踪进度。 - Alessandro D'Andria