【发布时间】:2011-11-29 22:29:30
【问题描述】:
我们正在使用下面的行来获取文件的上次访问日期和时间。
DateTime dtLastAccesstime = File.GetLastAccessTime(sFilePath);
但是我们面临一个奇怪的问题,上面的调用本身修改了 Last 访问时间。如此有效地,我们将当前时间作为上次访问时间。
【问题讨论】:
-
您确定该行附近没有可能修改上次访问日期的代码吗?
-
你在这行代码之前对
sFilePath做了什么吗? Raymond Chen 有一篇很好的文章,non-exhaustive list of innocuous activities that update the last accessed time
标签: c# lastaccesstime