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);