中文版 | English

网站首页 | 个人作品 | 站长日志 | 给我留言 | 经典分享 | 友情链接 | 黑白人生


简单文件列表

<%     Dim foldname,okstr   '自定义相对路径名   foldname= "db"   '自定义白名单后缀文件   okstr="rar,doc,xls,txt,mdb,asp"   If foldname = "" Then   foldname=geturlName()   urlfold=""   response.write foldname   Else   urlfold=foldname&"/"   End If   Call showfold(foldname)   Sub showfold(whichfold)   Dim Item, TheFolder,  Files    OKAr = split(okstr,",")   Set FSO = Server.CreateObject("Scripting.FileSystemObject")   If Fso.FolderExists(whichfold) = False Then    Response.write(whichfold + "  目录不存在或不允许访问!")   End If   Set TheFolder = Fso.GetFolder(whichfold)   Set Files = TheFolder.Files   For Each Item In Files     For Each str In OKAr    If InStr(Item.Name,str) Then    response.write ("<a href=./"&urlfold&Item.Name&"  target=_blank>"&Item.Name& "</a><br>")    Exit for    Else    End If    Next   Next   Set Files = Nothing   Set TheFolder = Nothing   Set Fso = Nothing   End Sub   Function getfilefolder(filespec)   Dim fsoin, f, s   Set fsoin = CreateObject("Scripting.FileSystemObject")   Set f = fsoin.GetFile(filespec)   s = f.ParentFolder    getfilefolder = s   Set f=Nothing   Set fsoin=Nothing   End Function   Function geturlName()      Dim strURL,intPos,strFileName      strURL = Request.Servervariables("PATH_INFO")      intPos = InstrRev(strURL,"/")        strFileName = left(strURL,intPos)      geturlName = Replace(strFileName,"/","")      End Function     %>



Copyright 1998-2021. All rights reserved.
工信部备案:冀ICP备19032940号-1|公安部备案号:13020802000209