asp遍歷目錄及子目錄的函數(shù)
更新時間:2008年07月22日 08:54:21 作者:
asp遍歷目錄以及目錄下文件的函數(shù)- 從網(wǎng)上找的不過都用不了,自己用Emeditor修正了一下
<%@ Language=vbscript %>
<%
'遍歷目錄以及目錄下文件的函數(shù)
%>
<%
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:盤
%>
<%
'遍歷目錄以及目錄下文件的函數(shù)
%>
<%
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+數(shù)據(jù)庫+JS)的實現(xiàn)代碼
關于無限分級(ASP+數(shù)據(jù)庫+JS)的實現(xiàn)代碼...2007-05-05
ASP實現(xiàn)GB2312字符與區(qū)位碼的相互轉換的代碼
ASP實現(xiàn)GB2312字符與區(qū)位碼的相互轉換的代碼...2007-05-05
ASP中用ajax方式獲得session的實現(xiàn)代碼
前期做的時候,登錄方式順手用了ajax來做,登錄前先判斷在session中是否存在值,如果存在,那么無需登錄;如果不存在,那就彈出登錄頁面登錄。2011-05-05
asp 獲取參數(shù)值與sql安全過濾參數(shù)函數(shù)代碼
下面的代碼是從aspcms系統(tǒng)中扒下的代碼,在獲取參數(shù)值與sql安全過濾參數(shù)方面做了限制2012-01-01
Coolite 中前臺獲取 GridPanel 當前選擇行值的代碼
掌握獲取 GridPanel 當前行的各個字段值的方法,需要的朋友可以參考下。2010-06-06

