仅获取比t年轻的文件

发布于 2025-01-25 23:00:27 字数 204 浏览 1 评论 0原文

有没有办法将文件从比特定年龄年轻的目录中获取?

因此,此方法将产生此结果,但是它将首先获取所有文件,然后忽略那些不适合的人,这效率很低。

dim files = dir.getfiles()。其中​​(function(x)x.lastwritetime> = ts)'dir:directoryInfo,ts:dateTime

Is there a way to get only the files out of a directory which are younger than a specific age?

So this method will produce this result, but it will get all files first and then disregard those who dont fit, which is quite inefficient.

Dim Files = dir.GetFiles().Where(Function(x) x.LastWriteTime >= ts) 'dir: DirectoryInfo, ts: DateTime

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文