FileSystemInfo.LastAccessTimeUtc 属性

定义

获取或设置上次访问当前文件或目录的时间,其格式为协调世界时 (UTC)。

public:
 property DateTime LastAccessTimeUtc { DateTime get(); void set(DateTime value); };
public DateTime LastAccessTimeUtc { get; set; }
[System.Runtime.InteropServices.ComVisible(false)]
public DateTime LastAccessTimeUtc { get; set; }
member this.LastAccessTimeUtc : DateTime with get, set
[<System.Runtime.InteropServices.ComVisible(false)>]
member this.LastAccessTimeUtc : DateTime with get, set
Public Property LastAccessTimeUtc As DateTime

属性值

DateTime

上次访问当前文件或目录的 UTC 时间。

属性

例外

Refresh() 不能初始化数据。

当前操作系统不是 Windows NT 或更高版本。

调用方试图设置无效的访问时间。

注解

备注

此方法可能会返回不准确的值,因为它使用本机函数,其值可能不会由操作系统持续更新。

如果对象的当前实例FileSystemInfo从以下DirectoryInfo任一方法返回,则属性的值LastAccessTimeUtc会预先缓存:

若要获取最新值,请调用 Refresh 该方法。

如果对象中描述的 FileSystemInfo 文件不存在,则此属性返回 1601 年 1 月 1 日午夜 12:00。 。协调世界时 (UTC)。

有关常见 I/O 任务的列表,请参阅 常见 I/O 任务

适用于

另请参阅