FileSystemInfo.LastWriteTimeUtc 属性

定义

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

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

属性值

DateTime

上次写入当前文件的 UTC 时间。

属性

例外

Refresh() 不能初始化数据。

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

调用方试图设置无效的写入时间。

注解

备注

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

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

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

如果对象中描述的 FileSystemInfo 文件或目录不存在,或者包含此文件或目录的文件系统不支持此信息,则此属性返回 12:00 午夜,1601 A.D。 。协调世界时 (UTC)。

适用于

另请参阅