使用WebClient显示下载进度

时间:2014-01-27 14:02:52

标签: c# visual-studio-2010 webclient

如何使用C#的WebClient异步显示下载进度?

2 个答案:

答案 0 :(得分:0)

请勿使用OpenRead明确打开文件。相反,只需像您一样致电DownloadFileAsync - DownloadProgressChanged处理程序UploadProgressChangedEventArgs.TotalBytesToSend,您可以向用户展示BytesSent甚至ProgressPercentage )。

答案 1 :(得分:0)

您可以使用WebClient.DownloadProgressChangedEvent来实现这一目标。