主页 > 知识库 > 文件遍历排序函数

文件遍历排序函数

热门标签:阿里云 电子围栏 银行业务 Mysql连接数设置 服务器配置 Linux服务器 科大讯飞语音识别系统 团购网站
%

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
%>

标签:蚌埠 广元 枣庄 萍乡 衡水 衢州 江苏 大理

巨人网络通讯声明:本文标题《文件遍历排序函数》,本文关键词  ;如发现本文内容存在版权问题,烦请提供相关信息告之我们,我们将及时沟通与处理。本站内容系统采集于网络,涉及言论、版权与本站无关。
  • 相关文章
  • 收缩
    • 微信客服
    • 微信二维码
    • 电话咨询

    • 400-1100-266