I did some Google search but couldn't find what I was looking for. I start multiple async downloads at the same time and I want to check which file is downloaded. How can I achieve this?

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

Thanks in advance! Regards

有帮助吗?

解决方案

In AsyncCompletedEventArgs there is a property UserState. This way you can access data that you set when you start the async task. Just fill in the path in the UserState and use it. To set the user data value, you can use this overload of DownloadFileAsync.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top