asp遍历目录及子目录的函数
2018-09-06 12:02
<%@Language=vbscript%>
<%
遍历目录以及目录下文件的函数
%>
<%
FunctionBianli(path)
SetFso=server.createobject(scripting.filesystemobject)
OnErrorResumeNext
SetObjfolder=fso.getfolder(path)
SetObjsubfolders=objfolder.subfolders
ForEachObjsubfolderInObjsubfolders
Response.writeNowpath
SetObjfiles=objsubfolder.files
ForEachObjfileInObjfiles
Response.write<br>---
Response.writeObjfile.name
Next
Response.write<p>
Bianli(nowpath)递归
Next
SetObjfolder=nothing
SetObjsubfolders=nothing
SetFso=nothing
EndFunction
%>
<%
Bianli(D:)遍历d:盘
%>
上一篇:ASP定义数组方法的技巧