文件夹中文件搜索

//根据最后写入日期排序
var dirs = from d in Directory.GetFiles(@"d:\", "*.*")
                       orderby Directory.GetLastWriteTime(d)
                       select d;
//遍历排序结果
dirs.ToList().ForEach(x => MessageBox.Show(x));
posted @ 2020-11-28 17:09  消逝的風  阅读(104)  评论(0)    收藏  举报