Hi Lup,
I was able to find a sample that Synchronizes a local folder to a folder over FTP. Try the following:
Visual Basic
---------------
Dim connection As FtpConnection = New FtpConnection(m_hostAddress, m_userName, m_password)
connection.KeepAliveInterval = intFTPKeepAlive
Try
Dim folder1 As AbstractFolder = New DiskFolder(strLocalFolder)
Dim folder2 As AbstractFolder = New FtpFolder(connection, strRemoteFolder)
Dim synOpt As New SynchronizationOptions()
synOpt.AutoConflictResolution = True
synOpt.AllowCreations = True
synOpt.AllowDeletions = True
synOpt.CompareFileData = True
synOpt.PreviewOnly = False
Try
Synchronizer.EasySynchronize(folder1, folder2, synOpt)
Catch eSynch As Exception
AddConnectionLogInformationLine("Synch error: {0}", eSynch.ToString())
End Try
Catch ex As Exception
AddConnectionLogInformationLine("Exception occured: " & ex.Message)
Finally
connection.CloseConnections()
End Try
---------------
C#
---------------
FtpConnection connection = new FtpConnection(m_hostAddress, m_userName, m_password);
connection.KeepAliveInterval = intFTPKeepAlive;
try {
AbstractFolder folder1 = new DiskFolder(strLocalFolder);
AbstractFolder folder2 = new FtpFolder(connection, strRemoteFolder);
SynchronizationOptions synOpt = new SynchronizationOptions();
synOpt.AutoConflictResolution = true;
synOpt.AllowCreations = true;
synOpt.AllowDeletions = true;
synOpt.CompareFileData = true;
synOpt.PreviewOnly = false;
try {
Synchronizer.EasySynchronize(folder1, folder2, synOpt);
} catch (Exception eSynch) {
AddConnectionLogInformationLine("Synch error: {0}", eSynch.ToString());
}
} catch (Exception ex) {
AddConnectionLogInformationLine("Exception occured: " + ex.Message);
} finally {
connection.CloseConnections();
}---------------
Marc
Developer in Technical Support
Xceed - Multi-talented components - http://xceed.com