网络编程 
首页 > 网络编程 > 浏览文章

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

(编辑:jimmy 日期: 2024/11/26 浏览:3 次 )
<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>

上一篇:用asp实现的代码批量修改程序,fso相关
下一篇:遍历目录以及目录下文件的函数
一句话新闻
一文看懂荣耀MagicBook Pro 16
荣耀猎人回归!七大亮点看懂不只是轻薄本,更是游戏本的MagicBook Pro 16.
人们对于笔记本电脑有一个固有印象:要么轻薄但性能一般,要么性能强劲但笨重臃肿。然而,今年荣耀新推出的MagicBook Pro 16刷新了人们的认知——发布会上,荣耀宣布猎人游戏本正式回归,称其继承了荣耀 HUNTER 基因,并自信地为其打出“轻薄本,更是游戏本”的口号。
众所周知,寻求轻薄本的用户普遍更看重便携性、外观造型、静谧性和打字办公等用机体验,而寻求游戏本的用户则普遍更看重硬件配置、性能释放等硬核指标。把两个看似难以相干的产品融合到一起,我们不禁对它产生了强烈的好奇:作为代表荣耀猎人游戏本的跨界新物种,它究竟做了哪些平衡以兼顾不同人群的各类需求呢?
友情链接:杰晶网络 DDR爱好者之家 南强小屋 黑松山资源网 白云城资源网 网站地图 SiteMap