Advertisement
ASP_Volume3 Files #45501

ASP Procedure Used To Recurse Through All SubFolders Of Any Given Path

Use it to recurse (walk-through) every sub-directory of any given path. Use it to find a file or list all files in any given path.

AI

Tóm tắt bởi AI: This codebase represents a historical implementation of the logic described in the metadata. Our preservation engine analyzes the structure to provide context for modern developers.

Mã nguồn
original-source
<%
	Sub Recurse(Path)
		
		Dim fso, Root, WindowsFolder, Files, _
			Folders, File, i, FoldersArray(100)
			
		Set fso = Server.CreateObject("Scripting.FileSystemObject")
		Set Root = fso.getfolder(Path)
		Set Files = Root.Files
		Set Folders = Root.SubFolders
		For Each File In Files
			'''''''''''''''''''''''''''''
			'Code For Each File Found
			'Goes Here!
			'''''''''''''''''''''''''''''
		Next
			
		For Each Folder In Folders
			'''''''''''''''''''''''''''''
			'Code For Each Folder Found
			'Goes Here!
			'''''''''''''''''''''''''''''
			FoldersArray(i) = Folder.Path
			i = i + 1
		Next
			 	
		For i = 0 To UBound(FoldersArray)
			If FoldersArray(i) <> "" Then 
				Recurse FoldersArray(i)				
			Else
				Exit For
			End If
		Next
		
	End Sub
%>
Bình luận gốc (3)
Được khôi phục từ Wayback Machine