一聚教程网:一个值得你收藏的教程网站

热门教程

asp读取目录下的文件

时间:2022-07-02 23:15:33 编辑:袖梨 来源:一聚教程网


<%
Dim sPath, oFso, oFout, File
sPath = "plugin/"
Set oFso = Server.CreateObject("Scripting.FileSystemObject")
Set oFout = oFso.GetFolder(Server.Mappath(sPath))
    Response.Write "" & _
    "" & _
    "" & _
    "" & _
    "" & _
    "" & _
    "" & _
    "" & _
    "" & _
    "" & _
    "" & _
    ""
    For Each File In oFout.Files
        Response.Write "" & _
        "" & _
        "" & _
        "" & _
        "" & _
        "" & _
        "" & _
        "" & _
        "" & _
        "" & _
        ""
    Next
    Response.Write "
文件名称文件短路径名文件物理地址文件属性文件大小文件类型文件创建时间最近访问时间最近修改时间
" & File.Name & "" & File.ShortPath & "" & File.Path & "" & File.Attributes & "(" & SenFe_Attributes(File.Attributes) & ")" & File.Size & "" & File.Type & "" & File.DateCreated & "" & File.DateLastAccessed & "" & File.DateLastModified & "
"
Set oFout = Nothing
Set oFso = Nothing
Function SenFe_Attributes(iType)
    Select Case iType
        Case 0 SenFe_Attributes = "Normal-普通文件, 没有设置任何属性."
        Case 1 SenFe_Attributes = "ReadOnly-只读文件,可读写."
        Case 2 SenFe_Attributes = "Hidden-隐藏文件,可读写."
        Case 4 SenFe_Attributes = "System-系统文件,可读写."
        Case 16 SenFe_Attributes = "Directory-文件夹或目录,只读."
        Case 32 SenFe_Attributes = "Archive-上次备份后已更改的文件,可读写."
        Case 1024 SenFe_Attributes = "Alias-链接或快捷方式,只读."
        Case 2048 SenFe_Attributes = "Compressed-压缩文件,只读."
    End Select
End Function
%>

热门栏目