Not pretty but it works
Public Function GetFolderInfo(ByVal strPath As String) As String
Dim item As String
Dim items() As String
Dim path As String = "F:\Inetpub\wwwroot\" & strPath
Dim arFolderArray As String
items = Directory.GetDirectories(path)
For Each item In items
arFolderArray = arFolderArray & Replace(item, path & "\", "") &
","
Next
Dim arFolder As Array
arFolderArray = Left(arFolderArray, Len(arFolderArray) - 1)
arFolder = Split(arFolderArray, ",")
Array.Sort(arFolder)
Dim x As Integer = 0
For x = 0 To UBound(arFolder)
Response.Write(arFolder(x) & " <br />")
Next
End Function
Mike
"Mike D" wrote:
> Can I control the order that files, folders are displayed? Can I do them
> alphabetically or do I need to upload to a db like we did in asp?
>
> items = Directory.GetDirectories(path)
> For Each item In items
> Response.Write(Replace(item, "F:\Inetpub\wwwroot\", "") & " <br
> />")
> Next
>
> Thanks
> Mike
|