|
返回与指定路径中的文件对应的File对象。
Jscript
- function ShowFileAccessInfo(filespec)
- {
- var fso, f, s;
- fso = new ActiveXObject("Scripting.FileSystemObject");
- f = fso.GetFile(filespec);
- s = f.Path.toUpperCase() + "<br>";
- s += "Created: " + f.DateCreated + "<br>";
- s += "Last Accessed: " + f.DateLastAccessed + "<br>";
- s += "Last Modified: " + f.DateLastModified
- return(s);
- }
复制代码
Vbscript
- 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
复制代码
|
|