异步下载完成后获取文件名

时间:2013-10-29 08:52:37

标签: vb.net

我做了一些谷歌搜索但找不到我要找的东西。我同时启动多个异步下载,我想检查下载的文件。我怎样才能做到这一点?

Private Sub client_DownloadCompleted(ByVal sender As Object, ByVal e As System.ComponentModel.AsyncCompletedEventArgs)

    MsgBox("Download Completed!") ' I want to add the name of the downloaded file in this message

End Sub

提前致谢! 此致

1 个答案:

答案 0 :(得分:0)

AsyncCompletedEventArgs中有一个属性UserState。这样,您可以访问在启动异步任务时设置的数据。只需填写UserState中的路径并使用它。 要设置用户数据值,您可以使用此DownloadFileAsync的重载。

相关问题