且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

C#进程无法访问文件,因为它正在被另一个进程使用

更新时间:2023-01-31 17:17:29

当您尝试访问属性时,似乎您的异步下载操作尚未完成.在访问文件之前,您确定下载已完成吗?

Looks like your asynch download operation is yet to complete when you try to access the properties. Have you made sure that the download is completed before accessing the file?

您可以在DownloadFileCompleted事件中访问文件.

You can access the file in the DownloadFileCompleted event.

http://msdn.microsoft.com/zh-CN/library/system.net.webclient.downloadfilecompleted.aspx