文章·资料 电脑软件 手机应用 网站源码




    本 站 搜 索
   推 荐 文 章        More...
华硕易电脑(ASUS Eee PC 1025C)..
先来段开场白:为了外出携带方便,到淘..
Acronis True Image 使用说明
  一款可以在Windows下使用全部功..
Norton Ghost 使用详解
一、分区备份   使用Ghost进行系..
    文 章 阅 读 排 行
Microsoft SQL Server 2000 Perso..
  对于第一次安装 Microsoft SQL Se..
MD5 算法的ASP实现代码
  MD5的全称是Message-Digest Algor..
BIOS 设置不能修改等问答5则
  问:电脑配置为:微星865PE主板、P4..
Windows 系统修改默认文件类型图标
Windows 系统文件类型图标,通常由默..
夸克网盘新用户注册如何获得1T空间
夸克网盘,新用户注册如何获得1T空间? ..
VMware Workstation:新添加的硬..
VMware Workstation 新添加的硬盘不..
CMD:Windows 系统 CMD 命令添加..
查看全部用户账号: net user 查..
Microsoft Internet Information ..
  简称:IIS,版本:5.0,运行环境:Wind..
关于使用 CSS 来控制 table 标签..
  在 HTML 语言中,table 标签的 cel..
使XHTML Strict 支持 target 标签
XHTML 1.0 Strict 之后就不支持 targe..
 文 章 信 息
ASP(FSO)文件列表排序
评论()〗〖留言〗〖收藏
〖文章分类:电脑·手机·网络 / 网站设计·开发·优化〗〖阅读选项
files_path=self_path.ParentFolder.ParentFolder
folderspec=files_path "\" dir_name
Set f = fso.GetFolder(folderspec)

Set fc = f.Files
For Each f1 in fc
response.write f1.name&"<br>"
next
---------------------------------------------------------------

<<%@LANGUAGE="VBSCRIPT'>%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<%
Function getFileInfo(filespec)'获取文件名和创建(修改)时间
Dim fs, f
dim s(1)
Set fs = CreateObject("Scripting.FileSystemObject")
Set f = fs.GetFile(filespec)
s(0) = "文件名" & f.Name & "<br>创建时间: " & f.DateCreated & "<br>"
s(1)=f.DateCreated
getFileInfo=s
End Function

Sub compositor(s0,s1)'冒泡排序
dim j,x
j=0
For i=0 to UBound(s1)
For j=0 to UBound(s1)-j
If Cint(Cdate(s1(i))-Cdate(s1(j)))>0 Then
x=s1(i)
s1(i)=s1(j)
s1(j)=x
x=s0(i)
s0(i)=s0(j)
s0(j)=x
End If
Next
Next
for i=0 to UBound(s0)
response.Write(s0(i))
next
End Sub

dir_name="abc"
Set fso = CreateObject("Scripting.FileSystemObject")
set self_path = fso.getfile(server.mappath(Request.ServerVariables("PATH_INFO")))
files_path=self_path.ParentFolder.ParentFolder
folderspec=files_path&"\" dir_name
Set f = fso.GetFolder(folderspec)

Set fc = f.Files
dim myFile(),fileCreateDate()
i=0
For Each f1 in fc
redim preserve myFile(i)
redim preserve fileCreateDate(i)
myFile(i)=getFileInfo(files_path&"\" dir_name&"\"&f1.name)(0)
fileCreateDate(i)=cdate(getFileInfo(files_path&"\" dir_name&"\"&f1.name)(1))
i=i 1
next
compositor myFile,fileCreateDate
%>

文章作者:未知  更新日期:2008-03-07
〖文章浏览:〗〖发送文章〗〖打印文章
相关文章 ·ASP(FSO)通过数组给文件列表排序2008-03-07