c# - Upload Download files from FTP site using SFTP -


i need know way connect ftp site through sftp. using sharpssh , unable find example program.

for now, have downloaded sharpssh .dll files , added references. need write code connect, , upload/download files ftp server.

how can ? help.

update enter image description here

code :

//ip of local machine , username , password along file uploaded via sftp.  fileuploadusingsftp("http://some-sftp-site.com", "username", "password", @"d:\", @"name.txt"); 

the above code in main method.

then ;

private static void fileuploadusingsftp(string ftpaddress, string ftpusername, string ftppassword, string filepath, string filename)         {             sftp sftp = null;             try             {                 // create instance sftp upload given files using given credentials                 sftp = new sftp(ftpaddress, ftpusername, ftppassword);                  // connect sftp                 sftp.connect();                  // upload file                 sftp.put(filepath + filename);                  // close sftp connection                 sftp.close();             }                         {                 if (sftp != null)                 {                     sftp.close();                 }             }         } 

what have done of right now?

we can't give straight answer on 'how upload files'....

here tutorial: http://saravanandorai.blogspot.com/2012/01/sftp-and-file-upload-in-sftp-using-c.html


Comments

Popular posts from this blog

jquery - Invalid Assignment Left-Hand Side -

java - Play! framework 2.0: How to display multiple image? -

gmail - Is there any documentation for read-only access to the Google Contacts API? -