I am wanting to databind a DropDownList control with a list of all sub directories that exist in a particular directory on the server. The directory I want to search is in the root of the application. I am fairly new to programming and I'm not sure where to even start.
I found this code on a website:
Dim root As String = "C;\"
Dim folders() As String = Directory.GetDirectories(root)
Dim sb As New StringBuilder(2048)
Dim f As String
For Each f In folders
Dim foldername As String = Path.GetFileName(f)
sb.Append("<option>")
sb.Append(foldername)
sb.Append("</option>")
Next
Label3.Text = "<select runat=""sever"" id=""folderlist""" & sb.ToString() & "</select>"
I guess this is vb. but my tool is in asp, so is their something similar in vbscript so that I can use it.