内容显示页
 
类别:ASP+VBS | 浏览(219) | 2006-7-18 13:47:00 | 关闭广告

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


引用本页地址:http://www.yongfa365.com/item/b33132d14c6be528.html
 
 
相关链接
 
网友评论:
姓名: 记住我
网址:
邮箱:
内容:
验证码:  验证码图片看不清? 换张图试试
 
   
 
 
文章分类
 
   

Power by :柳永法(yongfa365)'Blog | Model by :hibaidu | CSS by:众网友 | 京ICP备07011491号  QQ:64049027  E-mail:64049027qq.com

本空间赞助商:北京中科兴联信息技术有限公司