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.
Get file name after async download is complete
-
01-07-2022 - |
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
Solution
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow