Hi All,
I'm trying to create an application that can upload the same file to multiple local servers at the same time.
I'm using this function to upload the file:
private void UploadFile(string _ip, string _file)
{
//Setup the client and Credentials
WebClient wc = new WebClient();
wc.Credentials = new NetworkCredential("user", "pass");
//set the Async routines
wc.UploadFileCompleted += new UploadFileCompletedEventHandler(UploadFileDone);
wc.UploadProgressChanged += new UploadProgressChangedEventHandler(UploadProgress);
This Ip will then be passed to your call back method. So, in your methods for UploadFileDone and UploadProgress you will have Event Args available that will contain this ip address in the UserState property of the event args.
Bookmarks