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:
Something like that
foreach (FileInfo file in new DirectoryInfo("SomeFolder").GetFiles().Where(p => p.CreationTime < DateTime.Now.AddDays(-90)).ToArray()) File.Delete(file.FullName);