手机
当前位置:查字典教程网 >脚本专栏 >vbs >VBS教程:方法-GetFile 方法
VBS教程:方法-GetFile 方法
摘要:GetFile方法返回与指定路径中某文件相应的File对象。object.GetFile(filespec)参数object必选项。应为Fi...

GetFile 方法

返回与指定路径中某文件相应的

File 对象。

object.

GetFile(filespec)

参数

object

必选项。应为 FileSystemObject 的名称。

filespec

必选项。

filespec 是指定文件的路径(绝对路径或相对路径)。

说明

如果指定文件不存在,则会出现错误。

下面例子举例说明如何使用

GetFile 方法:

Function ShowFileAccessInfo(filespec) Dim fso, f, s Set fso = CreateObject("Scripting.FileSystemObject") Set f =

fso.GetFile(filespec

) s = f.Path & "<br>" s = s & "Created: " & f.DateCreated & "<br>" s = s & "Last Accessed: " & f.DateLastAccessed & "<br>" s = s & "Last Modified: " & f.DateLastModified ShowFileAccessInfo = sEnd Function

【VBS教程:方法-GetFile 方法】相关文章:

VBS教程:方法-GetParentFolderName 方法

VBS教程:方法-ReadLine 方法

VBS教程:方法-CreateFolder 方法

VBS教程:方法-WriteBlankLines 方法

VBS教程:方法-OpenTextFile 方法

VBS教程:方法-GetSpecialFolder 方法

VBS教程:方法-Read 方法

VBS教程:方法-MoveFile 方法

VBS教程:方法-Move 方法

VBS教程:方法-CopyFile 方法

精品推荐
分类导航