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
//Uploads all directories, subdirectories and files in the selected Directory asynchronously to the SSH server
System.Console.WriteLine("We are uploading the Download folder to the TestDir folder .This is a non-blocking call");
// All these calls do the same thing
sftp.CreateDirectory("TestDir");
sftp.UploadDirectoryAsync("C:\\Download", "TestDir");
/* sftp.UploadDirectoryAsync( "C:\\Download", "TestDir" , true, "*.*");
sftp.UploadDirectoryAsync( "C:\\Download", "TestDir" , true, new Regex(".+"));
sftp.UploadDirectoryAsync( "C:\\Download", "TestDir" , true, DateTime.MinValue, DateTime.MaxValue);
sftp.UploadDirectoryAsync( "C:\\Download", "TestDir" , true, 0, Int64.MaxValue);
*/
while (sftp.IsBusy == true)
{
System.Threading.Thread.Sleep(100);
}
System.Console.WriteLine("TestDir has now {0} KB", sftp.GetDirectorySize("TestDir") / 1024);