GetFile 方法返回與指定路徑中某文件相應(yīng)的 File 對(duì)象。 object.GetFile(filespec)
參數(shù)object 必選項(xiàng)。應(yīng)為 FileSystemObject 的名稱。 filespec 必選項(xiàng)。filespec 是指定文件的路徑(絕對(duì)路徑或相對(duì)路徑)。 說明如果指定文件不存在,則會(huì)出現(xiàn)錯(cuò)誤。 下面例子舉例說明如何使用 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 =s
End Function
請(qǐng)參閱GetAbsolutePathName 方法 | GetBaseName 方法 | GetDrive 方法 | GetDriveName 方法 | GetExtensionName 方法 | GetFileName 方法 | GetFolder 方法 | GetParentFolderName 方法 | GetSpecialFolder 方法 | GetTempName 方法 應(yīng)用于:FileSystemObject 對(duì)象
返回首頁(yè) |