Sorry for my ignorance on this one, but I'm not sure how to implement this. Here's my looping "search" routine:
I'm thinking it should create a new collection of "Songs" then add that to the current Album. Then once a collection of "Albums" has been made, add that to the collection for the current Band. Then once the Bands collection is made, add that to the Music Collection. But I just cant figure out how to nest the collection into the parent collection. Then be able to pull it out by "Music.Band(0).Album(0).Song(0).Title"Code:Sub MusicList() Dim MusicDirectory As New DirectoryInfo("d:\Music") Dim Bands As DirectoryInfo() = MusicDirectory.GetDirectories("*.*") Dim Band As DirectoryInfo For Each Band In Bands 'loop though folder containing Band Folders Dim BandDirectory As New DirectoryInfo(Band.FullName) Dim Albums As DirectoryInfo() = BandDirectory.GetDirectories("*.*") Dim Album As DirectoryInfo For Each Album In Albums 'Loop though Band Folder containing each album Dim AlbumDirectory As New DirectoryInfo(Album.FullName) Dim Songs As FileInfo() = AlbumDirectory.GetFiles("*.mp3") Dim song As FileInfo For Each song In Songs 'Loop through Album Folder containing Songs Next Next Next End Sub




Reply With Quote