title: VB 2010 Directory.GetFiles MultipleTypes [NOT A DUPE] The code wont work like the ones everyone tells me
body: <p>I'm trying to make it so it scans the computer for multiple files and logs it in a ListBox. That all works except when I get to the multiple types. I have tried almost everything on google. </p>
  
  <p>Needed Code:</p>
  
  <pre><code>If (Directory.Attributes &lt;&gt; FileAttributes.System) Then
                      allFiles = Directory.GetFiles("*.png;*.jpg", SearchOption.AllDirectories)
                  End If
  </code></pre>
  
  <p>Full Code:</p>
  
  <pre><code>Dim tempDir As New DirectoryInfo("C:\")
      Dim FileDetails(4) As String
      Dim iTem As ListViewItem
      Try
          Dim allFiles As FileInfo() = Nothing
          For Each Directory In tempDir.GetDirectories()
              Try
                  If (Directory.Attributes &lt;&gt; FileAttributes.System) Then
                      allFiles = Directory.GetFiles("*.png;*.jpg", SearchOption.AllDirectories)
                  End If
                  Dim oneFIle As FileInfo
  
                  For Each oneFIle In allFiles
                      FileDetails(0) = oneFIle.Name()
                      FileDetails(1) = oneFIle.FullName()
                      FileDetails(2) = oneFIle.Length() / (1024 * 1024)
                      FileDetails(2) = FileDetails(2).Remove(5)
                      iTem = New ListViewItem(FileDetails)
                      ListBox1.Items.Add(oneFIle.FullName)
                  Next
              Catch ex As Exception
  
              End Try
          Next
      Catch ex As UnauthorizedAccessException
  
      End Try
  </code></pre>