title: Get files & folders recursively in Windows Store Applications
body: <p>Previously in Windows Forms applications, <a href="http://support.microsoft.com/KB/303974" rel="nofollow" title="this">this</a> was how I searched a folder recursively for all files. I know that Windows Store applications are pretty much sandboxed however there must be a way to get all the files in a KnownFolder directory. I've been trying to do this with the music directory. However, it is not working for me. I've done my Googling and I can't find any thread that states how to achieve this. I have tried the following code:</p>
  
  <pre><code>private async void dirScan(string dir)
      {
          var folDir = await StorageFolder.GetFolderFromPathAsync(dir);
          foreach (var d in await folDir.GetFoldersAsync())
          {
              foreach(var f in await d.GetFilesAsync())
              {
                  knownMusicDir.Add(f.Path.ToString());
              }
              dirScan(d.ToString());
          }
      }
  </code></pre>
  
  <p>I hope someone can take a look at my code and hopefully correct it. Thanks in advance!</p>