I need to know content of directories with items older than one month. I'm using:
var directories = dir.GetDirectories("*", SearchOption.AllDirectories).Where(fi => fi.CreationTime < lastmonth).ToList();
But I need feedback about progress. Usually directories have thousands of files and sometimes the program seems to be stuck. It is a desktop application searching for old backup files on server. I would like to inform the user which directory is currently being searched.
Only way I know is to recursively go through the folder instead of using SearchOption.AllDirectories. See code below for example. Code below is creating an Xml file of all file/folders. Folder is the root where to start search.