Get files older than 2 months

Can anyone help me with a method to filter files old than 2 months, i need to put this before i start processing input files.

Assign files = Directory.GetFiles(“C:\YourFolderPath”)

Assign filteredFiles = files.Where(Function(f) New FileInfo(f).LastWriteTime < DateTime.Now.AddDays(60)).ToArray()

Use this in assign activities, filtered files will have the list of all the files. You can use it as required.

1 Like

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.