Listing directories - Printable Version +- BP Forums (https://bpforums.info) +-- Forum: Archived Forums (https://bpforums.info/forumdisplay.php?fid=55) +--- Forum: Archived Forums (https://bpforums.info/forumdisplay.php?fid=56) +---- Forum: VB.NET (Visual Basic 2010/2008) (https://bpforums.info/forumdisplay.php?fid=8) +---- Thread: Listing directories (/showthread.php?tid=391) |
Listing directories - Covert2String - 08-19-2011 Hi, I saw this video: <!-- m --><a class="postlink" href="http://www.youtube.com/watch?v=UwGjbPwrMXo">http://www.youtube.com/watch?v=UwGjbPwrMXo</a><!-- m --> to list all files in a directorie, however I need to list all sub directories, like this: ->Main dir -->file1 -->Sub dir --->file2 I need the app to list it this way: file1 Sub dir/file2 How can I do this? Re: Listing directories - brandonio21 - 08-19-2011 Hello Covert2String - Welcome to the forum!! Here is a code that should work for you, not sure if it is exactly what you wanted: Code: Dim output As String = "" Re: Listing directories - Covert2String - 08-20-2011 Thanks for the code, but it's not working exactly as I want, the application it's showing the absolute path, like this: C:\Users\REMOVED\Desktop\list\list\bin\Debug\actlist.vshost.exe C:\Users\REMOVED\Desktop\list\list\bin\Debug\actlist.vshost.exe C:\Users\REMOVED\Desktop\list\list\bin\Debug\act\ddlist.xml I want it only to show act\ddlist or the file if it's not in a sub dir. Re: Listing directories - brandonio21 - 08-20-2011 Ah okay, well what you can do is use this code... Code: Dim output As String = "" This should work! Re: Listing directories - Covert2String - 08-20-2011 Well, almost there! Idk why, but it writes the last file twice o.O Edit: Not only the last file but all of them... Re: Listing directories - brandonio21 - 08-20-2011 Well that could be a problem... Try this code! Code: Dim output As String = "" This should do it!!! Re: Listing directories - Covert2String - 08-20-2011 Not working, it repeats some files :S Edit: Forget it, my mistake! Thank you! You're a life saver! Re: Listing directories - brandonio21 - 08-20-2011 Ah, sounds good! I am glad I could help!! Do you fully understand the code? Re: Listing directories - Covert2String - 08-20-2011 Yes, all thanks to you! |