关闭

发一个以前写的遍历文件夹中文的文件夹,或指定类型(文件名)的文件夹

标签: filefunctiondatabaseeachemaildate
447人阅读 评论(0) 收藏 举报
<%
'
'--------------------------------------------------------------
'    Modules : IteratorFile
'    Description : connect database file
'    Version : beta 1.0
'    Script Written by never-online
'    last updated Date: 2005-6-22
'--------------------------------------------------------------
'    Copyright (C) 2005,2006 Miracle Tech. All rights reserved.
'    Web: http://www.never-online.net
'    Email: bluedestiny [at] 126 . com
'--------------------------------------------------------------
'    Depend file(s): const.asp
'
'--------------------------------------------------------------
Function iterateChineseFileName(fileFolder)
Set Folder=fso.getFolder(fileFolder)
Set FileSets=Folder.files
for Each f in FileSets
if re.test(f.name)=true then
response.Write f.path & "<br/>"
response.Flush
counter=counter+1
end if
if response.isclientconnected=false then response.End
next
Set SubFolder=Folder.SubFolders
For Each f in SubFolder
iterateChineseFileName(f.path)
Next
End Function
dim fso, re,fileFolder,counter
Set fso=Server.CreateObject("Scripting.FileSystemObject")
Set re=new RegExp
re.global=true
re.ignorecase=false
'--------------------------------------
'  pattern : file name ? or regular
'            expression
'--------------------------------------
re.pattern="^([/u0391-/uFFE5]+)/.(?:doc|txt)$"
fileFolder=server.mappath(".")
counter=1
iterateChineseFileName(fileFolder)
response.Write "total chinese file(s) " & counter & ""
%>
0
0

查看评论
* 以上用户言论只代表其个人观点,不代表CSDN网站的观点或立场
    个人资料
    • 访问:22944次
    • 积分:347
    • 等级:
    • 排名:千里之外
    • 原创:10篇
    • 转载:4篇
    • 译文:0篇
    • 评论:8条
    文章分类
    最新评论