views:

252

answers:

1

Title says it all. 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?

+4  A: 

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

Docs here.

inkedmn
That did it, thanks!
Cyclone
Question, how can I get all the files inside of all the subdirectories as well?
Cyclone
There's probably a pre-defined method for it, but otherwise just right a simple recursion.
phoebus
Ugh, that's *write* a simple recursion, sorry.
phoebus
@Cyclone: please read the documentation that was linked. Hint: Directory.GetFiles(string, string, SearchOptions)
jnylen
Directory.GetFiles(Path, "*", SearchOption.AllDirectories) did it. Much easier than what I was trying to do with it lol...
Cyclone