国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 編程 > ASP > 正文

文件遍歷排序函數

2024-05-04 11:02:41
字體:
來源:轉載
供稿:網友
<%

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

發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 卫辉市| 白银市| 巴彦淖尔市| 焦作市| 嘉峪关市| 驻马店市| 肃北| 修水县| 保康县| 新竹市| 瑞金市| 莱芜市| 景洪市| 连南| 建宁县| 莱阳市| 盖州市| 高安市| 临泉县| 凤凰县| 广德县| 葵青区| 临沭县| 东方市| 介休市| 毕节市| 平谷区| 蒙城县| 东山县| 始兴县| 高唐县| 鹰潭市| 万全县| 保定市| 古交市| 通山县| 曲靖市| 化隆| 搜索| 上栗县| 广东省|