Advertisement
Guest User

Untitled

a guest
Jan 18th, 2017
119
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.68 KB | None | 0 0
  1. void Upload(string filename)
  2. {
  3. try
  4. {
  5. Uri adress = new Uri("ftp://ftp.wsiz.rzeszow.pl/w53850");
  6. string path1 = Path.Combine(Path.GetDirectoryName(Application.ExecutablePath), "km2.xml");
  7. WebClient client = new WebClient();
  8. client.Credentials = new NetworkCredential(username, password);
  9. client.BaseAddress = "ftp://ftp.wsiz.rzeszow.pl/";
  10. client.UploadFile(filename,WebRequestMethods.Ftp.UploadFile, path1);
  11.  
  12. }
  13. catch (Exception ex)
  14. {
  15.  
  16. MessageBox.Show(ex.Message);
  17. }
  18. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement