ASP列举文件夹中所有的文件(包括子文件夹)

<%
'''''''''''''''''显示指定文件夹中所有的ASP文件
set fso=server.createobject("scripting.filesystemobject")
set folder=fso.getfolder("E:Victor")
response.write "<font color=red>所有的ASP文件如下:</font>"
response.write "<br/><br/>"
for each f in folder.files
If InstrRev(f.name,".asp") Then
response.write "&nbsp;&nbsp;&nbsp;&nbsp;" & f.path & "<br/>"             
End if
Next
response.write "<br/>"

'''''''''''''''''

'''''''''''''''''显示指定文件夹中所有子文件夹中的ASP文件

For Each ff In folder.subfolders
 
  response.write "<font color='red'>" & ff.path & "</font><br/><br/>"
  
  Set subfolder=fso.getfolder(ff.path)
 
  For Each item In subfolder.files

  If InstrRev(item.name,".asp") then
 
  response.write "&nbsp;&nbsp;&nbsp;&nbsp;"&item.path &"<br/>"
 
  End if
 
  Next
 
response.write "<br/>"

Next

'''''''''''''''''
%>
 

    A+
发布日期:2007年03月26日  所属分类:未分类

发表评论

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen: