获取某个日期范围内修改的所有文件
我们有一个 asp.net、C# 应用程序,其中需要获取所有修改日期为黑白 startdate 和 enddate 的文件。我们怎样才能做到这一点? 还想获取最近 3 个月内未修改的所有文件吗?
We have a asp.net,C# application in which there is a requirement to get all the files whose date modified will be b/w startdate and enddate . How can we achieve this ?
Also want to get all the files not modified for last 3 months ?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
根据这篇文章,你可以这样做:
According to this post, you could do this:
看看这个问题和答案:
如何使用以下命令查找目录中的最新文件.NET,并且没有循环?
您可以从那里开始并将
where
子句添加到答案中提供的 LINQ 查询中:)look at this question and answer:
How to find the most recent file in a directory using .NET, and without looping?
you can start from there and add your
where
clause to the provided LINQ query in the answer :)