FSO traverses a function of all files in a directory

xiaoxiao2021-03-06  77

<%

Function Bianli (PATH)

SET FSO = Server.createObject ("scripting.filesystemObject")

on Error ResMe 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 "
---"

Response.write objfile.name

NEXT

Response.write "

"

Bianli (nowPath) 'Recursive

Next

Set objfolder = Nothing

Set objsubfolders = Nothing

SET FSO = Nothing

END FUNCTION

%>

<%

Bianli ("D:") 'Traversing D: Disc

%>

转载请注明原文地址:https://www.9cbs.com/read-104913.html

New Post(0)