asp遍历目录及子目录的函数

2018-09-06 12:02

阅读:291

  <%@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:盘
%>


评论


亲,登录后才可以留言!