VB Scripts文件目录操作

  | 转载时请务必以超链接形式标明文章原文链接和作者信息及本版权声明。
原文链接:http://www.liaojl.com/archives/2009/07/vb-scripts-file.html

VB Scrtips中对文件和目录的操作通过CreateObject

查看文件创建、访问和修改日期

Function ShowFileAccessInfo(filespec)
  Dim fso, f, s
  Set fso = CreateObject("Scripting.FileSystemObject")
  Set f = fso.GetFile(filespec)
  s = UCase(filespec) & "<BR>"
  s = s & "创建:" & f.DateCreated & "<BR>"
  s = s & "最后一次访问:" & f.DateLastAccessed & "<BR>"
  s = s & "最后一次修改:" & f.DateLastModified  
  ShowFileAccessInfo = s
End Function

Leave a comment

Archives

Creative Commons License
This blog is licensed under a Creative Commons License.