Advertisement
Guest User

Untitled

a guest
Jul 7th, 2018
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.86 KB | None | 0 0
  1. // Listing
  2.  
  3. string host = "ip address";
  4. string user = "remote user name";
  5. string password = "remote user password";
  6.  
  7. SFTPData SftpData = new SFTPData(host, user, password);
  8. SFTPAgent SftpAgent = new SFTPAgent(SftpData);
  9.  
  10. SftpAgent.UploadFile("local address to file", "remote address to file");
  11.  
  12. SftpAgent.DownloadFile("local address to file", "remote address to file");
  13.  
  14. SftpAgent.Delete("remote address to file/directory");
  15.  
  16. SftpAgent.MoveFile("old remote address to file", "new remote address to file");
  17.  
  18. SftpAgent.CreateDirectory("remote address to new directory");
  19.  
  20. bool exists = SftpAgent.Exists("remote address to file/directory");
  21.  
  22. SftpAgent.UploadDirectory("local address to directory", "remote address to directory");
  23.  
  24. SftpAgent.DownloadDirectory("local address to directory", "remote address to directory");
  25.  
  26. // Disconnection is handled automaticly
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement