c# - How to get filename from UploadFileCompletedEventArgs? -


my goal filename of finished file e.

... webclient webclient = new webclient(); webclient.uploadfileasync(new uri(address, "stor", filename)); ...      void webclientuploadcompleted(object sender, uploadfilecompletedeventargs e)     {         //how filename e?     } 

uploadfileasync accepts user state fourth parameter. can change call to:

webclient.uploadfileasync(new uri(address), "stor", filename, filename); 

and retrieve in callback:

void webclientuploadcompleted(object sender, uploadfilecompletedeventargs e) {     var filename = (string)e.userstate; } 

Comments

Popular posts from this blog

javascript - Chart.js (Radar Chart) different scaleLineColor for each scaleLine -

apache - Error with PHP mail(): Multiple or malformed newlines found in additional_header -

java - Android – MapFragment overlay button shadow, just like MyLocation button -