I intend to search for the latest created Zip file from a folder by checking on their file names because all of them have the same standard naming convention like file_ddmmyyyy.zip
from their names I can tell the last file (file_10112019.zip) is the one that I am looking for, so I hope the robot could help me to return me the file name.
Seems like we need more details on the file names.
If two zip files with the same naming is downloaded then Windows will automatically append β(1)β or more counters to the existing filename.
It is better to get the file path based on the latest file rather than going with the names.
CASE 1 : Only one zip file is downloaded per day
β 1. Get all files from the directory. Split the name using the β_β as delimiter.
2. Parse exact the date using the string from the filename
3. Subtract DateTime.Now minus the date of file creation.