ASP DateCreated 属性

定义和用法

DateCreated 属性用于返回指定的文件或文件夹被创建的日期和时间。

语法:

  1. FileObject.DateCreated
  2. FolderObject.DateCreated

实例

针对 File 对象的例子

  1. <%
  2. dim fs,f
  3. set fs=Server.CreateObject("Scripting.FileSystemObject")
  4. set f=fs.GetFile("c:\test.txt")
  5. Response.Write("File created: ")
  6. Response.Write(f.DateCreated)
  7. set f=nothing
  8. set fs=nothing
  9. %>

输出:

  1. File created: 8/8/2008 8:8:00 PM

针对 Folder 对象的例子

  1. <%
  2. dim fs,fo
  3. set fs=Server.CreateObject("Scripting.FileSystemObject")
  4. set fo=fs.GetFolder("c:\test")
  5. Response.Write("Folder created: ")
  6. Response.Write(fo.DateCreated)
  7. set fo=nothing
  8. set fs=nothing
  9. %>

输出:

  1. Folder created: 8/8/2008 8:8:00 PM