<HTML><BODY>
<p style="font-weight:bold;border-bottom:3px double #000099">本站所有文档目录:</p>
<%Dim fso
Dim TabStop
Dim NewLine
NewLine =""
TabStop = ""
Set fso = Server.CreateObject("Scripting.FileSystemObject")Dim strRootDoc'strRootDoc =  Request.ServerVariables("PATH_TRANSLATED")
'strRootDoc = Left(strRootDoc,InStr(1,strRootDoc,"portal",1)-1) & "Documents\"Dim html
html=""
getFolderList fso.GetFolder("D:\asptest\"),html,0Response.Write html
'给出一个文件夹,列出其下的所有文件夹
Function getFolderList(oFolder,html,n)
Dim a
Dim tmp
tmp=""
Dim i
Dim strRootPath
For i = 1 To n
tmp=tmp & "&nbsp;&nbsp;"
Next
html = html & "<div id=""mxh" & n & """>"
For Each a In oFolder.SubFolders
'html = html & "<div><img src=""DocTypeIcons/folder16.gif"" align=absmiddle>&nbsp;<a href='Javascript:void(null)'>" & a.Name & "</a></div>" & chr(13)
html = html & "<div>" & tmp & "<img src=""DocTypeIcons/folder16.gif"" align=absmiddle>&nbsp;<a href='Javascript:void(null)'>" & a.Name & "</a></div>" & chr(13) If a.SubFolders.Count>0 Then
getFolderList a,html,n+1
End If
Next
html = html & "</div>"
End Function%>
</BODY>
</HTML>