Reputation: 18305
How can you obtain a list of files (as a stringcollection or some other storage method) which contains the full path on the user's computer to the files?
Is there a method for doing so?
Upvotes: 13
Views: 59470
Reputation: 4761
Dim txtFiles = Directory.GetFiles("C:\Input", "*.CSV", SearchOption.TopDirectoryOnly).
[Select](Function(nm) Path.GetFileName(nm))
Dim arrayList As New System.Collections.ArrayList()
For Each filenm As String In txtFiles
arrayList.Add(New clsImportFiles(filenm))
Next
Upvotes: 6
Reputation: 31
Add a Listbox to Windows Form and Add following code on Form Load or other events :-
ListBox1.Items.AddRange(Directory.GetFiles("Your Directory PAth Here"))
Hope IT Helps ; From Nirav
Upvotes: 3
Reputation: 28245
It looks like you want to use Directory.GetFiles()
in the System.IO
namespace.
Upvotes: 22