//Connect to the source
SFTP sftpSource = new SFTP();
sftpSource.HostAddress = "source host address";
sftpSource.UserName = "source user name";
sftpSource.Password = "source password";
sftpSource.EnableLogging();
sftpSource.Connect();
//Create a source directory on the source SFTP server
sftpSource.CreateDirectory("/SourceDir/Test");
sftpSource.CurrentDirectory = "/SourceDir/Test";
//Create a test file and upload two files to the source directory
File.WriteAllText("test1.txt", "This is test 1");
sftpSource.UploadFile("test1.txt", "test1.txt");
File.WriteAllText("test2.txt", "This is test 2");
sftpSource.UploadFile("test2.txt", "test2.txt");
sftpSource.CurrentDirectory = "/SourceDir";
//Connect to the destination
SFTP sftpDest = new SFTP();
sftpDest.HostAddress = "dest host address";
sftpDest.UserName = "dest user name";
sftpDest.Password = "dest password";
sftpDest.EnableLogging();
sftpDest.Connect();
//Create a dest directory on the dest SFTP server
sftpDest.CreateDirectory("DestDir/Test");
sftpDest.CurrentDirectory = "DestDir";
sftpSource.SiteToSiteDirectorySynchronization(sftpDest, "Test");
if (sftpDest.FileExists("test1.txt") && sftpDest.FileExists("test2.txt"))
Console.WriteLine("Success!");