最新下载
热门教程
- 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
%>
相关文章
- 原神2025最新兑换码有哪些 限时前瞻福利领取 11-16
- 百炼英雄2025兑换码大全 最新礼包福利领取合集 11-16
- 寻道大千2025兑换码 最新可用的礼包码合集 11-16
- 蛋仔派对2025兑换码 最新礼包码合集 11-16
- 元气骑士2025兑换码大全 最新可用礼包码合集 11-16
- 明日方舟终末地测试资格查询入口 官方验证方法一览 11-16