Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Get a list of all files inside of a directory in vb.net

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?

like image 930
Cyclone Avatar asked Sep 22 '09 00:09

Cyclone


People also ask

How do I see all files in a folder in Visual Studio?

On the menu bar, select Edit > Find and Replace. Choose Find in Files from the fly-out menu.


2 Answers

It looks like you want to use Directory.GetFiles() in the System.IO namespace.

Docs here.

like image 117
brettkelly Avatar answered Sep 29 '22 16:09

brettkelly


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

like image 36
Nirav Avatar answered Sep 29 '22 16:09

Nirav