SFTP sftp = new SFTP(); //Trial Mode
//SFTP sftp = new SFTP("place user name here", "place license key here");
// set the name of the SSH server( its URL )
sftp.HostAddress = "some.sftp.server.com"; // replace with your SFTP server
sftp.UserName = "anonymous"; // replace with your user name
sftp.Password = "user@mail.com"; // replace with your password
//Downloads all directories, subdirectories and files in the selected Directory asynchronously from FTP
System.Console.WriteLine("We are downloading the TestDir folder.This is a non-blocking call");
// All these calls do the same thing
sftp.DownloadDirectory("TestDir", "C:\\Download");
/* sftp.DownloadDirectory("TestDir", "C:\\Download", true, "*.*");
sftp.DownloadDirectory("TestDir", "C:\\Download", true, new Regex(".+"));
sftp.DownloadDirectory("TestDir", "C:\\Download", true, DateTime.MinValue, DateTime.MaxValue);
sftp.DownloadDirectory("TestDir", "C:\\Download", true, 0, Int64.MaxValue);
*/
while (sftp.IsBusy == true)
{
System.Threading.Thread.Sleep(100);
}
System.Console.WriteLine("{0} files have been Transferred", sftp.FileCount);