folder.GetDirectories

Discussion in 'General Computer Support' started by murulimadhav, Sep 28, 2010.

  1. murulimadhav

    murulimadhav

    Joined:
    Sep 28, 2010
    Messages:
    1
    Hi,
    I am developing one Image gallery based on folders and directories using scripts of image gallery from Scott Mitchell (mitchell@4guysfromrolla.com).
    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
    murulimadhav, Sep 28, 2010
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Guest
    Replies:
    55
    Views:
    1,503
    Guest
    Apr 15, 2004
  2. Paul - xxx
    Replies:
    2
    Views:
    591
    Monsignor Larville Jones MD
    Aug 20, 2003
  3. Gary Rose

    XP Q uests: Cookies Folder? Pop-Up Ads Folder ?

    Gary Rose, Oct 15, 2003, in forum: Computer Support
    Replies:
    0
    Views:
    395
    Gary Rose
    Oct 15, 2003
  4. Tommy T

    Folder options - Like current folder

    Tommy T, Apr 10, 2004, in forum: Computer Support
    Replies:
    2
    Views:
    509
    Tommy T
    Apr 10, 2004
  5. nospam@nospam.net.org.com

    How do I make a folder shortcut icon look cooler than just a folder?

    nospam@nospam.net.org.com, Mar 22, 2005, in forum: Computer Support
    Replies:
    3
    Views:
    3,245
    nospam@nospam.net.org.com
    Mar 22, 2005
Loading...

Share This Page