當前位置:開發者網絡 >> 技術教程 >> ASP教程 >> FSO專題 >> 內容
精彩推薦
分類最新教程
分類熱點教程
    
遍歷目錄以及目錄下文件的函數
作者:未知
日期:2004-03-11
人氣:
投稿:xiaxia(轉貼)
來源:未知
字體:
收藏:加入瀏覽器收藏
以下正文:
<%@ Language=VBScript%>
<%function bianli(path)
set fso=server.CreateObject("scripting.filesystemobject")

on error resume next
set objFolder=fso.GetFolder(path)

set objSubFolders=objFolder.Subfolders

for each objSubFolder in objSubFolders

nowpath=path + "\" + objSubFolder.name

Response.Write nowpath

set objFiles=objSubFolder.Files

for each objFile in objFiles
Response.Write "<br>---"
Response.Write objFile.name
next
Response.Write "<p>"
bianli(nowpath)'遞歸

next
set objFolder=nothing
set objSubFolders=nothing
set fso=nothing
end function
%>
<%
bianli("d:") '遍歷d:盤
%>

--------------------------------------
很不錯哦。
相關文章: