Reputation: 252
I'm working in Windows 8 Operating System building Windows Store apps.
I'm trying to access one XML file(present within the solution) via the code below.
var file = System.Xml.Linq.XDocument.Load(@"E:\Gowtham\Data.xml");
But I'm getting "Access to the path 'E:\Gowtham\Data.xml' is denied.'" exception.
I tried all possible ways to remove the read-only attribute of the folder and the file but no use.
I used command prompt to change the attributes of the file, also I tried manually but the read-only attribute of that folder is not changed.
Kind help pls.
Upvotes: 0
Views: 1214
Reputation: 15296
You can't get ANY file like that way. I highly recommend you to read these links. You can access files from library if you have declared library access capability.
File system places accessible through WinRT API
Windows 8: The right way to Read & Write Files in WinRT
Upvotes: 2