内容显示页
 
类别:ASP+VBS | 浏览(308) | 2007-6-5 9:40:43
<%
Sub ListFolderContents(Path) Dim fs, Folder, File, Item, url Set fs = CreateObject("Scripting.FileSystemObject") Set Folder = fs.GetFolder(Path) 'Display the target folder and info. Response.Write("<li><b>" & Folder.Name & "</b> - " & Folder.Files.Count & " files, ") If Folder.SubFolders.Count > 0 Then Response.Write(Folder.SubFolders.Count & " directories, ") End If Response.Write(Round(Folder.Size / 1024) & " KB total." & vbCrLf) Response.Write("<ul>" & vbCrLf) 'Display a list of sub folders. For Each Item in Folder.SubFolders ListFolderContents(Item.Path) Next 'Display a list of files. For Each Item in Folder.Files url = MapURL(Item.Path) Response.Write("<li><a href=""" & url & """>" & Item.Name & "</a> - " & Item.Size & " bytes, " & "last modified on " & Item.DateLastModified & "." & "</li>" & vbCrLf) Next Response.Write("</ul>" & vbCrLf) Response.Write("</li>" & vbCrLf) End Sub Function MapURL(Path) Dim rootPath, url 'Convert a physical file path to a URL for hypertext links. rootPath = Server.MapPath("/") url = Right(Path, Len(Path) - Len(rootPath)) MapURL = Replace(url, "\", "/") End Function ListFolderContents(server.mappath("/")) %>

引用本页地址:http://www.yongfa365.com/item/a5649582f8436311.html
 
 
相关链接
 
网友评论:
姓名: 记住我
网址:
邮箱:
内容:
验证码:  验证码图片 看不清? 换张图试试
 
     
 
 
文章分类
 
 
.Net + C#(73)
 
 
ASP+VBS(161)
 
 
 
Linux(10)
 
 
 
web 2.0(26)
 
 
 
 
 
心程(68)
 
生活(97)
 
 
     

Power by :柳永法(yongfa365)'Blog  | 京ICP备07011491号  QQ:64049027  E-mail:64049027@qq.com yongfa365'CodePlex yongfa365'CodeGoogle

申请友情链接 要求:跟本站主题相类似正规网站,双方交换为首页位置

转载请注明来源,以便后人及时得到最新、修正、加强版!!!