Results 1 to 12 of 12

Thread: Exclude path from scan

Threaded View

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Sep 2010
    Posts
    101

    Exclude path from scan

    Hey guys I have this code to scan my folder and list the files in a listbox:

    vb Code:
    1. Dim LOCAL = "F:\Family"
    2.         'Dim LOCAL As String = My.Computer.FileSystem.GetFiles("F:\Family", FileIO.SearchOption.SearchAllSubDirectories)
    3.         Dim xmlFiles() As String = Directory.GetFiles(LOCAL, "*.xml", SearchOption.AllDirectories)
    4.         Dim srtFiles() As String = Directory.GetFiles(LOCAL, "*.srt", SearchOption.AllDirectories)
    5.         Dim aviFiles() As String = Directory.GetFiles(LOCAL, "*.avi", SearchOption.AllDirectories)
    6.         ListBox2.Items.Clear()
    7.         ListBox1.Items.Clear()
    8.         For Each avi As String In aviFiles      
    9.             If Array.IndexOf(xmlFiles, avi.Replace(".avi", ".xml")) >= 0 Then
    10.                 ListBox1.Items.Add(avi)
    11.             ElseIf Array.IndexOf(srtFiles, avi.Replace(".avi", ".srt")) >= 0 Then
    12.                 ListBox1.Items.Add(avi)
    13.             Else
    14.                 ListBox2.Items.Add(avi)
    15.             End If
    16.         Next

    Is there an option to exclude one path inside the "LOCAL"? Like scan and list everything but "F:\Family\Pictures", "F:\Family\Texts"...

    Thank you.
    Last edited by Acrobater; May 6th, 2012 at 10:12 AM.
    Thank you VB Forums!

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