最新下载
热门教程
- 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
%>
相关文章
- 原神执灯人怎么通关-幽境危战执灯人打法攻略 11-06
- 轮盘英雄四个隐藏单位解锁攻略分享 11-06
- World of Sea Battle铁获取攻略分享 11-06
- 逃离鸭科夫人物语音替换方法分享 11-06
- 绯红编年史哇哦有龙成就解锁攻略 11-06
- 天命重启心跳的抉择第四章全流程攻略 11-06