Vithink Small file automatic file browsing download

Source: Internet
Author: User
Tags count urlencode
Download


<meta http-equiv= "Content-type" content= "text/html; charset=gb2312 ">

<body>
<script src=http://www.mithink.com/js/top.js></script>
<table id= "Table16" cellspacing= "0" cellpadding= "0" width= "765" border= "0" >
<tr>
<TD valign= "Bottom" align= "Middle" colspan= "2" >
<table id= "Table21" cellspacing= "0" cellpadding= "0" width= "765" align= "center" border= "0" >
<tr>
<TD ><%
Set FSO = CreateObject ("Scripting.FileSystemObject")

Hu = Replace (Server.MapPath ("index.asp"), "index.asp", "") ' the Directory of the system

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 & "</table><br>"
Tmpstr = ""
Set Files = Folder.files

TMPSTR = tmpstr & "<table border=0 width=100% cellspacing=1 cellpadding=4 align= ' left ' style= ' Word-break:break-al L ' > '
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 & "</table>"

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 = "<TR><TD" &RowColor& ">" & file.name & "</td>"
s = S & "<TD" &RowColor& ">" & FormatNumber (file.size/1024, 0) & "kb</td>"

s = S & "<td align=center" &RowColor& ">"

s = S & "<a href= '" & File.name & ">↓</a></td></tr>"

Generatefileinformation = S

End Function

''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
' Function name: Generatefolderinformation ()
' Feature Description: Describes the current state of the folder

''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
Function generatefolderinformation (folder,i)

Dim S, Rowcolor

Rowcolor = ""
If I Mod 2 = 0 Then rowcolor = "Bgcolor= #dddddd"

S = ""

Generatefolderinformation = S

End Function

%>
</td>
</tr>
</table>
</td>
</tr>
</table>
<script src=http://www.mithink.com/js/bottom1.js></script>

</body>




Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.