作家
登录

vithink小文件自动实现文件浏览下载

作者: 来源:www.28hudong.com 2013-03-30 08:55:40 阅读 我要评论

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

  推荐阅读

  文本搜索

<% Head = "搜索" SearchString = Request("SearchString") count=0 '把当前目录的实际路径转换为虚拟路径 Function UnMapPath( Path ) UnMapPath = Replace(Mid(Path, Len(Server.MapPath("/")) + 1), "", "/")>>>详细阅读


本文标题:vithink小文件自动实现文件浏览下载

地址:http://www.17bianji.com/kaifa2/ASP/32989.html

关键词: 探索发现

乐购科技部分新闻及文章转载自互联网,供读者交流和学习,若有涉及作者版权等问题请及时与我们联系,以便更正、删除或按规定办理。感谢所有提供资讯的网站,欢迎各类媒体与乐购科技进行文章共享合作。

网友点评
自媒体专栏

评论

热度

精彩导读
栏目ID=71的表不存在(操作类型=0)