VBS教程:属性-DateCreated 属性


DateCreated 属性

返回指定的文件或文件夹的创建日期和时间 。只读 。

object.DateCreated

object 应为 File 或 Folder 对象的名称 。

说明

以下代码举例说明如何使用 DateCreated 属性:

Function ShowFileInfo(filespec)  Dim fso, f  Set fso = CreateObject("Scripting.FileSystemObject")  Set f = fso.GetFile(filespec)  ShowFileInfo = "创建:" & f.DateCreatedEnd Function