delete files from directory c# is 1.5 years older than code example
Example: c# delete files older than 10 days
using System.IO;
string[] files = Directory.GetFiles(dirName);
foreach (string file in files)
{
FileInfo fi = new FileInfo(file);
if (fi.LastAccessTime < DateTime.Now.AddDays(-10))
fi.Delete();
}