Question

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

Was it helpful?

Solution

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.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top