c# - Windows Phone 8.1 access file in Documents folder -


i'm new windows phone development, , not using silverlight or wpf. copy file "links.txt" windows phone folder @ "\documents\" , want access , content in file, i'm getting access denied error. click on package.appxmanifest file select "capabilities" tab, don't see "documents library access" me check it. matter fact don't see "... library access" showing. below code:

string filename = "\\documents\\links.txt"; string parentpath = applicationdata.current.localfolder.path; string filepath = path.combine(parentpath, filename); storagefile file = await storagefile.getfilefrompathasync(filepath); 

any suggestion how can read file? thanks.

updates:

it seems code above not work, when using code below , change folder "music" instead of "documents" check capabilities "musiclibrary", it's working.

 var folder = knownfolders.musiclibrary;  var file = await folder.getfileasync("links.txt");  var read = await fileio.readtextasync(file); 

thanks!

you give wrong filepath actual path in image

enter image description here

i try code shows same error correct file path


Comments

Popular posts from this blog

Django REST Framework perform_create: You cannot call `.save()` after accessing `serializer.data` -

Why does Go error when trying to marshal this JSON? -