我是靠谱客的博主 贤惠太阳,这篇文章主要介绍asp遍历目录及子目录的函数,现在分享给大家,希望可以做个参考。

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

最后

以上就是贤惠太阳最近收集整理的关于asp遍历目录及子目录的函数的全部内容,更多相关asp遍历目录及子目录内容请搜索靠谱客的其他文章。

本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
点赞(205)

评论列表共有 0 条评论

立即
投稿
返回
顶部