Earlier in Windows Forms applications, this was what I was looking for a folder recursively for all files. I know that Windows Store apps are pretty much isolated, but there should be a way to get all the files in the KnownFolder directory. I tried to do this using the music catalog. However, this does not work for me. I made my Googling, and I cannot find a thread that says how to achieve this. I tried the following 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());
}
}
I hope someone can take a look at my code and hopefully fix it. Thanks in advance!
timur source
share