国产探花免费观看_亚洲丰满少妇自慰呻吟_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
%>

發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 中方县| 阿荣旗| 盐山县| 东宁县| 漯河市| 曲水县| 阿克陶县| 将乐县| 华安县| 上蔡县| 金寨县| 攀枝花市| 栾川县| 修武县| 卢龙县| 炎陵县| 东乌珠穆沁旗| 鄄城县| 和林格尔县| 剑河县| 夏邑县| 安丘市| 玛纳斯县| 韶关市| 榕江县| 二连浩特市| 巍山| 平和县| 平湖市| 漯河市| 大连市| 宜宾县| 民权县| 玉龙| 南昌县| 黄龙县| 启东市| 启东市| 朝阳县| 忻州市| 唐海县|