Results 1 to 3 of 3

Thread: Filter a search? *[resolved]*

  1. #1

    Thread Starter
    Addicted Member ProgrammerJon's Avatar
    Join Date
    Jan 2003
    Location
    Canada
    Posts
    203

    Question Filter a search? *[resolved]*

    Code:
    Private Sub MenuItem5_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MenuItem5.Click
            ' make a reference to a directory
            Dim di As New IO.DirectoryInfo("c:/")
            Dim diArr As IO.DirectoryInfo() = di.GetDirectories()
            Dim diar1 As IO.FileInfo() = di.GetFiles()
    
    
    
    
            ' list the names of all the subdirectories in the specified directory
            Dim dri As IO.DirectoryInfo
    
            'BeginUpdate method freezes painting while you add items
            ListBox1.BeginUpdate()
            For Each dri In diArr
                ListBox2.Items.Add(dri)
            Next
    
            'EndUpdate resumes painting of listbox
            ListBox1.EndUpdate()
    
            'list the names of all files in the specified directory
            Dim dra As IO.FileInfo
            For Each dra In diar1
                ListBox1.Items.Add(dra)
            Next
            Dim r As String()
            r = IO.Directory.GetDirectories("c:/")
            ListBox1.DataSource = r
    
        End Sub
    How can I make it so that this program only returns files that have .mp3 extension?
    Last edited by ProgrammerJon; Feb 8th, 2003 at 04:32 PM.

  2. #2
    Banished Cander's Avatar
    Join Date
    Dec 2000
    Location
    Why do you care?
    Posts
    6,913
    .GetFiles(pattern As string)
    Stack Overflow
    See the features of Visual Studio 2010 and C# 4.0: The 10-4 show on Channel9

  3. #3

    Thread Starter
    Addicted Member ProgrammerJon's Avatar
    Join Date
    Jan 2003
    Location
    Canada
    Posts
    203
    Thanks,

    another question;
    how do you make it so that I searches subdiretories as well?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width