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

首頁 > 編程 > ASP > 正文

文件遍歷排序函數

2020-07-27 13:23:57
字體:
來源:轉載
供稿:網友
<%

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

發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 哈巴河县| 武宁县| 茶陵县| 东阳市| 沅江市| SHOW| 汕头市| 盐山县| 桦甸市| 鲁山县| 兴安县| 通海县| 吉安县| 井冈山市| 山东省| 泽普县| 新田县| 昌乐县| 宁德市| 金秀| 犍为县| 温州市| 昭通市| 宁强县| 鹤岗市| 南昌县| 兴国县| 蒲江县| 昌图县| 平度市| 芦溪县| 鞍山市| 襄汾县| 隆德县| 河西区| 内江市| 昌吉市| 武威市| 乌拉特后旗| 尖扎县| 天台县|