Re: grabbing the subdirectories that are 5 minutes old
So what does it do when "it doesn't work"? Consider posting a session log file, if appropriate, to document the problem.
transferOptions.FileMask = "*<=10N";
string localPath = ConfigurationManager.AppSettings["localPath"];
string remotePath = ConfigurationManager.AppSettings["remotePath"];
using (Session session = new Session())
{
// Connect
session.Open(sessionOptions);
// Download files
TransferOptions transferOptions = new TransferOptions();
transferOptions.TransferMode = TransferMode.Binary;
transferOptions.FileMask = "*<=10N";
TransferOperationResult transferResult;
transferResult =
session.PutFiles(@"K:\*", "/D:/eFiles/", true, transferOptions);
// Throw on any error
transferResult.Check();
// Print results
foreach (TransferEventArgs transfer in transferResult.Transfers)
{
Console.WriteLine("Download of {0} succeeded", transfer.FileName);
}
}
TransferOptions transferOptions = new TransferOptions();
transferOptions.TransferMode = TransferMode.Binary;
TransferOperationResult transferResult;
transferResult =
session.PutFiles(@"K:\Documents\*", "/D:/Files/", true, transferOptions);
// Throw on any error
transferResult.Check();