c# - Get File inside a folder with getFilesAsync and getFoldersAsync -
having this
public ireadonlylist<storagefolder> folderlist; and it
folderlist = await musicfolder.getfoldersasync(commonfolderquery.groupbyalbum); i should have folders inside music folder (musicfolder knownfolders.musiclibrary)
but when inside cicle try
for (int i=0; i<folderlist.count; i++) { if (folderlist[i].name==(lbmusic_albums.selecteditem songstruct).songname) { storagefolder current = folderlist[i]; ireadonlylist<storagefile> tempfilelist = await current.getfilesasync(commonfilequery.orderbyname); //other code i on await line system argument exception.. not understand why, passing correctly?
system.argumentexception: value not fall within expected range. @ windows.storage.storagefolder.getfilesasync(commonfilequery query) @ dus.mainpage.d__31.movenext()
solved in way :d
folderlib = await musicfolder.getfoldersasync(commonfolderquery.groupbyalbum); //obtaining folders , every folder foreach(storagefolder item in folderlib) { // take subfolder subfolderlib = await item.getfilesasync(); // , stuff } folderlib , subfolderlib were
public ireadonlylist<storagefile> subfolderlib; public ireadonlylist<storagefolder> folderlib;
Comments
Post a Comment