//Create some test files
Dictionary<string, string> files = new Dictionary<string, string>();
for (int i = 0; i < 10; i++)
{
string filePath = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "uploadfile" + i + ".txt");
File.WriteAllText(filePath, "This is a test");
files.Add(filePath, Path.GetFileName(filePath));
}
Stopwatch watch = new Stopwatch();
SFTP sftp = new SFTP(); //Trial Mode
//SFTP sftp = new SFTP("place user name here", "place license key here");
// set the name of the SFTP server( its URL )
sftp.HostAddress = "sftp.fsz.bme.hu"; // a hungarian university. change this to your sftp server
sftp.UserName = "anonymus"; // replace with your user name
sftp.Password = "user@mail.com"; // replace with your password
sftp.Connect();
sftp.CurrentDirectory = "/";
sftp.UploadFilesInParallel(files);
//Delete local files
foreach (var file in files)
{
File.Delete(file.Key);
}
sftp.DownloadFilesInParallel(files);
sftp.Disconnect();