最新下载
热门教程
- 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
%>
相关文章
- 边缘人群的心理特征与社会融入路径 - 2026年深度解析 06-16
- GitHub Copilot响应慢排查:代理设置与缓存清理要点 06-16
- GitHub Copilot实用插件:功能对比、配置限制与使用场景说明 06-16
- 植物大战僵尸2如何应对海底执政官僵尸 06-16
- 冲鸭表情包下载 - 可爱卡通动态图免费获取 06-16
- Cursor设计场景用法:界面原型、组件库与代码生成配置说明 06-16