作家
登录

文件遍历排序函数

作者: 来源:www.28hudong.com 2013-03-30 08:55:55 阅读 我要评论

<% function bianli(path) 'initiate path = server.mappath(path) set fso=server.CreateObject("scripting.filesystemobject") set objFolder=fso.GetFolder(path) set objfiles = objfolder.files '把文件名及文件路经存入theFiles数组 int slot = 0 Dim theFiles() redim theFiles(50) for each objFile in objFiles filename = objFile.name filePath = split(objFile.path,"docs") thepath1 = "./docs/" thepath = thepath1 & filepath(1) theFiles(slot) = filename&"**"&thepath slot = slot + 1 if slot > UBound(theFiles) then ReDim Preserve theFiles(Slot+20) end if next ReDim Preserve theFiles(slot) '冒泡排序 for i = 0 to UBound(theFiles)-2 for j = i+1 to UBound(theFiles)-1 if strComp(theFiles(i),theFiles(j)) = 1 then tmp = theFiles(i) theFiles(i) = theFiles(j) theFiles(j) = tmp end if next next '输出 for i = 0 to UBound(theFiles)-1 para = theFiles(i) filename = split(para,"**",-1,1)(0) filepath = split(para,"**",-1,1)(1) %> <p align = "left"> ---<img src='../../images/arrow_orange.gif' width='14' height='11'> <a href='<%=filepath%>'><span class="activelink_yellow"><%=filename%></span></a> </p> <% next end function %>

  推荐阅读

  构建免受 FSO 威胁虚拟主机(三)

此时会弹出如下图所示的“安全”警告,点“删除”: <IMG SRC="http://202.100.116.12/paddy/bbsimages/fsosafe/012.gif" border=0>   此时安全选项卡中的所有组和用户都将被清空(如果没有清空,请使用“删除”>>>详细阅读


本文标题:文件遍历排序函数

地址:http://www.17bianji.com/kaifa2/ASP/32997.html

关键词: 探索发现

乐购科技部分新闻及文章转载自互联网,供读者交流和学习,若有涉及作者版权等问题请及时与我们联系,以便更正、删除或按规定办理。感谢所有提供资讯的网站,欢迎各类媒体与乐购科技进行文章共享合作。

网友点评
自媒体专栏

评论

热度

精彩导读
栏目ID=71的表不存在(操作类型=0)