Hi,
I am developing one Image gallery based on folders and directories using scripts of image gallery from Scott Mitchell ().
And in this we use Dim subFolders As DirectoryInfo() = folder.GetDirectories()
And in this i am filtering the directories like
Dim subFolders As DirectoryInfo() = folder.GetDirectories("*Trips*")
And , my question is can we add more filters like
Dim subFolders As DirectoryInfo() = folder.GetDirectories("*Trips*,*Tours*") etc...
This script i typed is not working, and just for example i gave this here sir.
I hope i will get my question answered here
yours faithfully
murulimadhav
the script is
Private Function AddNodeAndDescendents(ByVal folder As DirectoryInfo, ByVal parentNode As TreeNode) As TreeNode
'Add the TreeNode, displaying the folder's name and storing the full path to the folder as the value...
Dim virtualFolderPath As String
If parentNode Is Nothing Then
virtualFolderPath = VirtualImageRoot
Else
virtualFolderPath = parentNode.Value & folder.Name & "/"
End If
Dim node As New TreeNode(folder.Name, virtualFolderPath)
'Recurse through this folder's subfolders
Dim subFolders As DirectoryInfo() = folder.GetDirectories("*Tour*")
For Each subFolder As DirectoryInfo In subFolders
Dim child As TreeNode = AddNodeAndDescendents(subFolder, node)
node.ChildNodes.Add(child)
Next
Return node 'Return the new TreeNode
End Function
|