I need to implement asynchronous downloading by using WebClient.DownloadDataAsync Method
I've defined event handler as following:
Private Sub DownloadCompleted(sender As Object, e As DownloadDataCompletedEventArgs) Dim bytes() As Byte = e.Result 'do somthing with result End Sub But I need to pass to this event handler an additional parameter together with downloaded result , value with which I created URI. For example:
Dim pictureURI = "http://images.server.sample.com/" + myUniqueUserIdentifier
I need to get myUniqueUserIdentifier on callback in DownloadCompleted sub.
I'm registering my event handler by using the following code:
AddHandler webClient.DownloadDataCompleted, AddressOf DownloadCompleted
I've only one guess, to extend WebClient object and to override DownloadDataCompleted object. But before I'm going to perform this I'd like to check is there more simpler solution?
Thank you.
sender?