c# - Why does getting C:\ with StorageFolder GetFolderFromPathAsync return an exception? -


i using following code

            storagefolder folder;             if (initial) folder = await storagefolder.getfolderfrompathasync(@"c:\");             else { use folder picker } 

and every time try storage drive returns error, have noticed if use folder picker doesnt throw exception.

i not sure causing , seems pretty irritating users have specify drive instead of application automatically getting it.

exception description "access denied.\r\n"

in uwp cannot list files/drives (with official api) - design, security reasons. windows store apps isolated , access granted limited resources/locations. in case freely able access virtual locations musiclibray, pictureslibrary , on. list of access permisions find at msdn.

when using picker won't exception, hence user has granted access app.


Comments