發表于:2009-11-15 00:00:00來源:海南(nán)易陽網絡人氣:3144
<%
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 & " 文件,<ul>" & vbCrLf)
for each item in folder.SubFolders
ListFolderContents(item.Path)
next
for each item in folder.Files
'如果需要鏈接文件
'<a href=""" & MapURL(item.path) & """ target='_blank'>" & item.Name & "</a>
'實際路徑:" & 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\")
%>