程序師世界是廣大編程愛好者互助、分享、學習的平台,程序師世界有你更精彩!
首頁
編程語言
C語言|JAVA編程
Python編程
網頁編程
ASP編程|PHP編程
JSP編程
數據庫知識
MYSQL數據庫|SqlServer數據庫
Oracle數據庫|DB2數據庫
 程式師世界 >> 編程語言 >> 網頁編程 >> ASP編程 >> 關於ASP編程 >> vithink小文件自動實現文件浏覽下載

vithink小文件自動實現文件浏覽下載

編輯:關於ASP編程
<html>

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

</head>

<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","") '本系統所在目錄



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-all'>"
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

''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
' 函數名稱:GenerateFolderInformation()
' 功能說明:描述文件夾的當前狀態

''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
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>

</html>

  1. 上一頁:
  2. 下一頁:
Copyright © 程式師世界 All Rights Reserved