Re: How to get last n days files from SFTP Folder using C#
If you want to filter the files by time, use the
https://winscp.net/eng/docs/library_remotefileinfo#lastwritetime
Like this:
RemoteFileInfo.LastWriteTime
property:
https://winscp.net/eng/docs/library_remotefileinfo#lastwritetime
Like this:
session.EnumerateRemoteFiles(SFTPRootDir, FileNamePattern, EnumerationOptions.None)
.Where(file => !file.LastWriteTime => DateTime.Now.AddDays(-N))