發表于:2009-11-15 00:00:00來(lái)源:海南(nán)易陽網絡人(rén)氣:3148
<%
sub ListFolderContents(path)
dim fs, folder, file, item, url
set fs = CreateObject("Scripting.FileSystemObject")
set folder = fs.GetFolder(path)
' Response.Write("<li><b>" & folder.Name & "</b>-總共發現" & folder.Files.Count & " 文件(jiàn),<ul>" & vbCrLf)
for each item in folder.SubFolders
ListFolderContents(item.Path)
next
for each item in folder.Files
'如(rú)果需要鏈接文件(jiàn)
'<a href=""" & MapURL(item.path) & """ target='_blank'>" & item.Name & "</a>
'實際路(lù)徑:" & item.path & "
Response.Write("<li><b>../EyDataBase_Backup/" & item.Name & "</b></li>" & vbCrLf)
next
Response.Write("</ul>" & vbCrLf)
Response.Write("</li>" & vbCrLf)
end sub
function MapURL(path)
MapURL = Replace(Right(path, Len(path) - Len(Server.MapPath("/"))), "\", "/")
end function
ListFolderContents("F:\WebCmsByLwp\EyDataBase_Backup\")
%>