I have two programs, One create a .txt
file when you click a button, and named those files with differences names like: "test1.txt
, test2.txt
, test3.txt
...etc." (The name of the files are not consecutive). The other program must open the file that was created last, and the only way to know which file was the last, is with "data modified" filter; because those file are created inside a specific folder (I use Windows 7 as Operating System).
How can I open the last file that was created by the fist program?
Example:
test1.txt--- data modified: 08/03/2016 06:33am
test3.txt----data modified: 08/03/2016 06:35am
test4.txt----data modified: 08/03/2016 07:26am
test2.txt----data modified: 08/03/2016 09:35am
I want open/read this file
I saw a lot of examples of the tool "FileSystemWatcher", but I really know how to compare the "data modified". Or exists another way to do that?