VBISCOOL
10-27-2004, 04:41 AM
Hello all,
Supposing I have a path e.g C:\Documents and Settings\jxe3Desktop\Various
and this was called LongPath
Using system.IO how can I get the program to get every item in this path and list it in, say a textbox or listview??
I've tried IO.directory.getfiles() but i can't do anything with it.
Any help much appreciated
Thanks
VBISCOOL
10-27-2004, 10:31 AM
Actually I would also be willing to use the FIle System object if this happens to be better than IO for this thing. Whatever works.
Bear in mind that i know the full path name but i don't know everything that's physically in the path because some items will filenames will have been truncated making them difficult to locate.
Thanks
JustAdotNETUser
10-27-2004, 08:30 PM
Hello all,
Supposing I have a path e.g C:\Documents and Settings\jxe3Desktop\Various
and this was called LongPath
Using system.IO how can I get the program to get every item in this path and list it in, say a textbox or listview??
I've tried IO.directory.getfiles() but i can't do anything with it.
Any help much appreciated
Thanks
This is what I'd use........
Dim FileDirList() As String = Directory.GetFiles(LongPath)
For i As Integer = 0 To FileDirList.GetUpperBound(0)
Debug.WriteLine(FileDirList(i)) 'Obviously change this to add to whatever control you want
Next
excaliber
10-28-2004, 06:32 AM
If you want all the files and subdirectories under that directory as well, use a recursive or iterative search.
http://www.visualbasicforum.com/showthread.php?t=158264