<% Set FSO = CreateObject("Scripting.FileSystemObject")
hu = Replace(Server.MapPath("index.asp"),"index.asp","") '本系统所在目录
Set TestFolder = FSO.GetFolder(hu) GenerateTestInformation = GenerateAllFolderInformation(TestFolder)
Function GenerateAllFolderInformation(Folder)
Dim S, SubFolders, SubFolder, Files, File, i tmpStr = "" Set SubFolders = Folder.SubFolders
If SubFolders.Count <> 0 Then i = 1 For Each SubFolder In SubFolders i = i + 1 tmpStr = tmpStr & GenerateFolderInformation(SubFolder,i) Next End If Response.Write tmpStr & " |
" tmpStr = "" Set Files = Folder.Files
tmpStr = tmpStr & "" tmpStr = tmpStr & ""
If Not (Folder.IsRootFolder) Then tmpStr = tmpStr & "" End If tmpStr = tmpStr & "" tmpStr = tmpStr & ""
If Files.Count <> 0 Then i = 1 For Each File In Files i = i + 1 tmpStr = tmpStr & GenerateFileInformation(File,i) Next End If
Response.Write tmpStr & " "
End Function
Function UrlEnCode(Path) UrlEnCode = Replace(Server.URLEncode(Path),"\","/") End Function
Function CloseFSO FSO.Close Set FSO = Nothing End Function
Function GenerateFileInformation(File,i)
Dim S, RowColor
RowColor = "" If i Mod 2 = 0 Then RowColor = "bgcolor=#9999dd" If i Mod 2 <> 0 Then RowColor = "bgcolor=#aaaaee"
S = " |
| " & File.Name & " | "
S = S & "" & FormatNumber(File.Size/1024 ,0) & " KB | "
S = S & ""
S = S & " ↓ |
"
GenerateFileInformation = S
End Function
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
' 函数名称:GenerateFolderInformation()
' 功能说明:描述文件夹的当前状态
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
Function GenerateFolderInformation(Folder,i)
Dim S, RowColor
RowColor = ""
If i Mod 2 = 0 Then RowColor = "bgcolor=#dddddd"
S = ""
GenerateFolderInformation = S
End Function
%>
提示:
本文由神整理自网络,如有侵权请联系本站删除!
本站声明:
1、本站所有资源均来源于互联网,不保证100%完整、不提供任何技术支持;
2、本站所发布的文章以及附件仅限用于学习和研究目的;不得将用于商业或者非法用途;否则由此产生的法律后果,本站概不负责!