Does WebClient.OpenFileAsync fire DownloadProgressChanged

社会主义新天地 提交于 2019-12-06 08:59:35

I've looked at the framework source and as far as I can tell the OpenReadAsync never touches the stuff that triggers DownloadProgressChanged.

It doesn't call GetBytes like DownloadDataAsync and DownloadFileAsync do, which is what in turn appears to be kicking off the event.

To work around it I've just used DownloadDataAsync instead, which does trigger the event and allows me to provide UI feedback for the download. It returns a byte array instead of the stream I needed, but that's not an issue.

So I'm assuming that it's MSDN that's wrong here, and OpenReadAsync doesn't trigger DownloadProgressChanged.

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!