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