I've used this code in the past:
Sub GetThemeNames(ByVal themePath As String)
If Not Directory.Exists(themePath) Then
Return
End If
Dim root As New DirectoryInfo(themePath)
Dim dirs() As DirectoryInfo = root.GetDirectories()
Dim dir As DirectoryInfo
Dim pathName As String
For Each dir In dirs
pathName = Path.GetFileName(dir.Name))
' do something with pathName
Next
End Sub
Call it with:
GetThemeNames(Server.MapPath("App_Themes"))
or
Dim v As String = GetSystemVersion().Replace("v", "").Replace(".", "_")
GetThemeNames("d:\inetpub\wwwroot\aspnet_client\system_web\" & v & "\Themes\")
The first uses the local themes, the second global themes (if you have any)
Dave