如何利用FSO对某个目录下的文件(文件夹)排序显示?

就是利用FSO显示某个目录下的文件或文件夹时,如何进行排序。比如:按照文件大小排序、文件修改日期排序,或者是按照文件名排序等等。
我想了很久也没有想到好的办法,大家说有什么好的办法。谢谢!
---------------------------------------------------------------

贴出邮箱,我有现成的程序
---------------------------------------------------------------

'假设这是你的文件夹
folderPath = "d:\test"

set fso = server.CreateObject("Scripting.FileSystemObject")

set myfolder = fso.GetFolder

for each objFile in myfolder.Files
filename = objFile.Name
....
next

'file 对象有如下属性:
Attributes 属性 ¦ DateCreated 属性 ¦ DateLastAccessed 属性 ¦ DateLastModified 属性 ¦ Drive 属性 ¦ Name 属性 ¦ ParentFolder 属性 ¦ Path 属性 ¦ ShortName 属性 ¦ ShortPath 属性 ¦ Size 属性 ¦ Type 属性

---------------------------------------------------------------

http://btyz.51web.cn/works.asp有显示的源码
http://btyz.51web.cn/article.asp有排序的文章

Published At
Categories with Web编程
Tagged with
comments powered by Disqus