asp中文件夹遍历降序排列的问题

guo851214 2014-05-26 07:50:23
下面这段代码是由小到大升序排列的,请问如何改成降序排列?
<%
Sub ShowFolderList(folderspec)
Dim fs, f, f1, fc, s, schild,p,fsize
Set fs = CreateObject("Scripting.FileSystemObject")
Set f = fs.GetFolder(folderspec)
Set fc = f.SubFolders
For Each f1 in fc
s = f1.name
's = s & vbCrLf
p = f1.DateLastModified
fsize = f1.Size
schild=folderspec&s&"\"

Response.write("<table width='780' border='0' cellspacing='1' cellpadding='1'>")
Response.write("<tr>")
Response.write("<td width='300' bgcolor='#ECFFD9'><font face='Wingdings' font size='3pt'>0</font><a href='getinfo.asp?foldinfo="&schild&"'>"&s&"</a></td>")
Response.write("<td width='180' bgcolor='#ECFFD9'>"&fsize&"</td>")
Response.write("<td width='300' bgcolor='#ECFFD9'>"&p&"</td>")
Response.write("</tr>")
Response.write("</table>")

Next
End Sub

Sub showfolderinfo(folderspc)
set MyFileObject=Server.CreateObject("Scripting.FileSystemObject")


Set MyFolder=MyFileObject.GetFolder(folderspc)

for each thing in MyFolder.Files
'Response.write("<br>"&thing)
'===============Get file information
Set afile=MyFileObject.GetFile(thing)

'==========filename correct code
filenamecode=afile.name
filedetail=folderspc+filenamecode
filedetail=replace(filedetail,"\","*s_p_l_i_t*")
filesize=afile.size
lastmodify=afile.DateLastModified

Response.write("<table width='780' border='0' cellspacing='1' cellpadding='1'>")
Response.write("<tr>")
Response.write("<td width='300' bgcolor='#f4f4ff'><font face='Wingdings' font size='3pt'></font><a href="&chr(34)&"Javascript:fileinfo('"&filenamecode&"','"&filesize&"','"&lastmodify&"')"&chr(34)&">"&filenamecode&"</a></td>")
Response.write("<td width='180' bgcolor='#f4f4ff'>"&filesize&"</td>")
Response.write("<td width='300' bgcolor='#f4f4ff'>"&lastmodify&"</td>")
Response.write("</tr>")
Response.write("</table>")
Next
End sub
%>
...全文
161 2 打赏 收藏 转发到动态 举报
写回复
用AI写文章
2 条回复
切换为时间正序
请发表友善的回复…
发表回复
hookee 2014-05-31
  • 打赏
  • 举报
回复
用离线Recordset方法,把文件名存到记录集里,用 recordset的sort方法排序即可
战A 2014-05-30
  • 打赏
  • 举报
回复
把你排序代码贴出来啊,不然没法帮你啊,朋友

28,390

社区成员

发帖
与我相关
我的任务
社区描述
ASP即Active Server Pages,是Microsoft公司开发的服务器端脚本环境。
社区管理员
  • ASP
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧