📅  最后修改于: 2022-03-11 14:48:47.010000             🧑  作者: Mango
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();
}