Howdy,
I am trying to figure out a way to loop through subfolders, with in a folder. I've got the code that will loop through an inital folder but I was wondering if anyone had suggestions on how to go about subfolders efficently and what the best way or ways that have worked for them?
This is the code I have so far. I'm thinking I need to just have it loop back with a new strPath?
Dim strPath As String
strPath = Server.MapPath("images")
Dim FolderCollection As String()
Dim i As Integer
FolderCollection = Directory.GetDirectories(strPath)
Dim bloExists As Boolean
For i = 0 To FolderCollection.Length - 1
myDirInfo = New DirectoryInfo(FolderCollection(i))
Response.Write("<a href='images\" & myDirInfo.Name & "'>" & myDirInfo.Name & "</a><br>")
Next
I am trying to figure out a way to loop through subfolders, with in a folder. I've got the code that will loop through an inital folder but I was wondering if anyone had suggestions on how to go about subfolders efficently and what the best way or ways that have worked for them?
This is the code I have so far. I'm thinking I need to just have it loop back with a new strPath?
Dim strPath As String
strPath = Server.MapPath("images")
Dim FolderCollection As String()
Dim i As Integer
FolderCollection = Directory.GetDirectories(strPath)
Dim bloExists As Boolean
For i = 0 To FolderCollection.Length - 1
myDirInfo = New DirectoryInfo(FolderCollection(i))
Response.Write("<a href='images\" & myDirInfo.Name & "'>" & myDirInfo.Name & "</a><br>")
Next