I am trying to capture the problem of connection while using WebClient, eg, unattainable, timeout etc. Code belows work
It does not, as if there is nothing wrong in it.
webclient wc = new webclient (); {Wc.UploadFileAsync (@ url (@ "ftp: //tabletijam/FileServer/upload.bin"), Directory.GetCurrentDirectory () + @ "\ crypto.bin"); } Hold (prior to System.Exception) {MessageBox.Show (ex.ToString ()); }
You are using, just sends the file ... Apply async section. WebClient webclient = new webclient (); WebClient.UploadFileAsync (address, filename); WebClient.UploadProgressChanged + = WebClientUploadProgressChanged; WebClient.UploadFileCompleted + = Includes WebClientUpload; ... Zero WebClientUploadProgressChanged (Object Sender, UploadProgressChangedEventArgs E) {Console.WriteLine ("Download {0}% complete.", E.ProgressPercentage); } Void WebClientUpload (Object Sender, UploadFileCompletedEventArgs e) {// Upload is finished, is clean}
Comments
Post a Comment