最新下载
热门教程
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
asp 取文件相关信息与取目录相关信息
时间:2022-07-02 23:02:22 编辑:袖梨 来源:一聚教程网
'参数:文件名(相对路径)
'返回值:0大小 1创建时间 2最后修改时间 3最后浏览时间 4路径 5类型 6名称
Public Function GetFileInfo(FileName)
Dim f,temp
Dim file(7)
On Error Resume Next
temp = Server.Mappath(FileName)
If oFso.FileExists(temp) Then
Set f = oFso.Getfile(temp)
file(0) = Lib.FormatNumberStr(f.Size / 1024,1) &" KB"
file(1) = Lib.DateFormat(f.DateCreated,"y-M-D H:N:S")
file(2) = Lib.DateFormat(f.DateLastModified,"y-M-D H:N:S")
file(3) = Lib.DateFormat(f.DateLastAccessed,"y-M-D H:N:S")
file(4) = f.Path
file(5) = f.Type
file(6) = f.Name
End If
If Err <> 0 Then Err.Clear
GetFileInfo = file
Set f = Nothing
End Function
'作用:取目录相关信息
'参数:目录名(相对路径)
'返回值:0大小 1创建时间 2最后修改时间 3最后浏览时间 4路径 5类型 6名称
Public Function GetfolderInfo(folderName)
Dim f,temp
Dim folder(7)
On Error Resume Next
temp = Server.Mappath(folderName)
If oFso.folderExists(temp) = True Then
Set f = oFso.Getfolder(temp)
folder(0) = Lib.FormatNumberStr(f.Size / 1024,1) &" KB"
folder(1) = Lib.DateFormat(f.DateCreated,"y-M-D H:N:S")
folder(2) = Lib.DateFormat(f.DateLastModified,"y-M-D H:N:S")
folder(3) = Lib.DateFormat(f.DateLastAccessed,"y-M-D H:N:S")
folder(4) = f.Path
folder(5) = f.Type
folder(6) = f.Name
End if
If Err <> 0 Then Err.Clear
GetfolderInfo = folder
Set f = Nothing
End Function
%>
相关文章
- z-libirary软件-强大功能与独特特点 02-28
- 漫蛙manwa2最新版本下载官方正版入口-下载安装教程及常见问题解答 02-28
- 羞羞漫画-官网快捷入口 02-28
- Deepseek网页版-Deepseek云端入口 02-28
- 蛙漫app下载安装包最新版-安卓苹果都能用的官方正式版 02-28
- 推特网页版极速体验-twitter网页流畅访问 02-28