How to select files that were saved in a folder in the last 1 hour

Hi,

I have a folder with 30+ files, out of which i need to check whether 15 specific files stored there are having the last modified time within the past 30 minutes.
How to solve this.

Thanks in Advance.

Hi @SudhakarAs92

You can use

Directory.GetFiles("FolderPath")

Now apply a for each loop, because the above statement would return an array of filename, use below code for LastWriteTime

Directory.GetLastWriteTime(yourFilePath)

Have an if condition if the lastwritetime is less than

DateTime.Now.AddMinutes(30)

then use MOve file activity

Thanks,
Prankur

4 Likes