Results 1 to 3 of 3

Thread: Filter a search? *[resolved]*

Threaded View

  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.

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