c# - How to read file from a non default library location in WinRT? -
i have folderpicker
user able choose folder like. want read files folder, cloud d:\foo\bar
.
since sample code have been able find reads of default knownfolders
have no clue how this. assume user have permissions read said folder.
i have started wonder if possible since have not found samples of it.
does 1 have clue? writing in c#.
folderpicker
returns storagefolder
instance property of knownfolders
class. means can enumerate files in same way:
var picker = new folderpicker(); picker.filetypefilter.add("*"); var folder = await picker.picksinglefolderasync(); foreach (var file in await folder.getfilesasync()) { var contents = await fileio.readtextasync(file); }
the above code reads files in folder text else.
Comments
Post a Comment