I would like to know (using C#) how I can delete files in a certain directory older than 3 months, but I guess the date period could be flexible.
Just to be clear:
Basically you can use Directory.Getfiles(Path) to get a list of all the files. After that you loop through the list and call GetLastAccessTim() as Keith suggested.