博客园  :: 首页  :: 新随笔  :: 联系 :: 订阅 订阅  :: 管理

sfo获取文件夹列表收藏

Posted on 2009-03-16 16:43  ^_^木头人  阅读(112)  评论(0)    收藏  举报

 

 

笔记收集

调用方法, <%=ShowFolderList(server.MapPath("manage_admin"))%> <% 'sfo获取文件列表,以下是函数 Function ShowFolderList(folderspec)  Dim fso, f, f1, fc, s  Set fso = Server.CreateObject("Scripting.FileSystemObject")  Set f = fso.GetFolder(folderspec)  Set fc = f.Files  s="文件编号"&"&nbsp;&nbsp;文件链接地址&nbsp;&nbsp;"&"文件名称<br>"  allpath="http://"&request.ServerVariables("HTTP_HOST")&"/"&split(request.ServerVariables("URL"),"/")(1)&"/"  counts=1  For Each f1 in fc   myname = f1.name   s = s &cint(counts)&"&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"&allpath&myname&"&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"&myname   s = s & " <BR>"   counts=counts+1  Next  ShowFolderList = s End Function %>