Reputation: 19
I am trying to retrieve a file data using C# code
StorageFile pFile = await StorageFile.GetFileFromPathAsync(filepath);
I am getting E_ACCESSDENIED
if my path is other than the AppData
of my Project.
I am working on Visual studio 2012 for Windows 8. Even though files have read/write access and admin rights access, still getting same error.
Can anyone suggest what is going wrong?
Upvotes: 1
Views: 1592
Reputation: 3286
Your app runs in a sandbox. The only location you can access are the app installation path, localappdata and if you have activated the libraries.
Read this msdn article to get all possible file location: MSDN Link
In addition to the default locations, a Windows Store app can access more files and folders by declaring capabilities in the app manifest (see App capability declarations), or by calling a file picker to let the user pick files and folders for the app to access (see Quickstart: Accessing files with file pickers).
Upvotes: 1