SecureFTPConnection ftpConnection = new SecureFTPConnection();
ftpConnection.LicenseOwner = "<LicenseInfo>";
ftpConnection.LicenseKey = "<LicenseInfo>";
EnterpriseDT.Util.Debug.Logger.CurrentLevel = EnterpriseDT.Util.Debug.Level.ALL;
EnterpriseDT.Util.Debug.Logger.AddAppender(new EnterpriseDT.Util.Debug.FileAppender(Path.Combine(Directory.GetParent(System.Reflection.Assembly.GetExecutingAssembly().Location).ToString(), @"ftp.txt")));
ftpConnection.Protocol = FileTransferProtocol.SFTP;
ftpConnection.ServerAddress = "ime.groupcbf.com";
ftpConnection.ServerPort = 22;
ftpConnection.ConnectMode = FTPConnectMode.PASV;
ftpConnection.AuthenticationMethod = AuthenticationType.PublicKey;
ftpConnection.UserName = "ubuntu";
ftpConnection.Password = ftpConnection.ClientPrivateKeyPassphrase = @"";
ftpConnection.Timeout = 10000;
ftpConnection.ServerValidation = SecureFTPServerValidationType.None;
ftpConnection.ClientPrivateKeyFile = Path.Combine(Directory.GetParent(System.Reflection.Assembly.GetExecutingAssembly().Location).ToString(), @"PrivateKey.ppk");
// ftpConnection.TransferType = FTPTransferType.ASCII;
ftpConnection.Connect();
string workingDirectory = ftpConnection.WorkingDirectory;
ftpConnection.ChangeWorkingDirectory(@"/home/ubuntu/workspace/source_ime");
workingDirectory = ftpConnection.WorkingDirectory;
ftpConnection.DownloadDirectory(@"C:\groupcbf\ime\test", @"db/vendor/.svn");
workingDirectory = ftpConnection.WorkingDirectory;
ftpConnection.DownloadDirectory(@"C:\groupcbf\ime\test", @"db/vendor/plugins");
My debugger shows that the working directory before the second downloaddirectory statement has been changed to
/home/ubuntu/workspace/source_ime/db/vendor
Hence the second downloaddirectory statement fails unless I manually switch the working directory back to the original one (statement for this not included). Thanks in advance.
P.S.: If you need the generated logs just drop me an email and I will mail them over to you.
P.S.2: I am running this project using .Net2.0 in case this is of any significance