• 0

[VB.NET] Scan Sub-Directories With...


Question

As some of you may know, I'm writing my own MP3 player in VB.NET as a learning project. So far it's coming along nicely. It reads ID3v1 tags, reads and writes an XML playlist, add files/directories and some other crap. One thing I'm stuck on at the moment however is getting it to scan sub-directores when adding a directory. Say I have the following folder layout:

+ Music
   + Led Zeppelin
       - IV
   + Pink Floyd
       - The Wall

With the FolderBrowserDialog, if I select the Pink Floyd parent folder it won't scan any sub-directores and essentially add nothing to the playlist. Any ideas on how I could get it to read sub-directories?

Thanks,

Shannon. :)

Link to comment
Share on other sites

2 answers to this question

Recommended Posts

  • 0

You need to use a recursive function, this little bit of ?pseudo code? should give you an idea

function DoSearch( directory : string )
begin

  while FindFile(directory) is not NULL
  begin
    if FoundFile is Directory then
      DoSearch (FoundFile)
    else
      AddToPlaylist (FoundFile)
  end

end

Link to comment
Share on other sites

This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.