Advertisement
calfred2808

search multiple files by extension file name

Apr 12th, 2019
243
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
VB.NET 0.49 KB | None | 0 0
  1. Dim FExtension1 As String = "*.txt"
  2. Dim FExtension2 As String = "*.exe"
  3. Dim FExtension3 As String = "*.sys"
  4.  
  5. For Each file1 In IO.Directory.GetFiles(Dir, FExtension1)
  6.     ' add to list box or append to text box or a Datagridview
  7. Next
  8.  
  9. For Each file1 In IO.Directory.GetFiles(Dir, FExtension2)
  10.     ' add to list box or append to text box or a Datagridview
  11. Next
  12.  
  13. For Each file1 In IO.Directory.GetFiles(Dir, FExtension3)
  14.     ' add to list box or append to text box or a Datagridview
  15. Next
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement