1
Windows 저장소 응용 프로그램을 만듭니다. MainPage.xaml.cs를 나는 XML 파일에서 데이터를 얻을 싶지만 줄에 오류 메시지가 :Windows 저장소 응용 프로그램에서 경로에 대한 액세스가 거부되었습니다.
XDocument document = XDocument.Load(filename).
UnauthorizedAccessException 사용자 코드에 의해 처리되지 않은했다
C '경로에 대한 액세스가 : \ 이벤트 Project \ events.xml '이 (가) 거부되었습니다.
모든 조언을 받으실 수 있습니다.
MainPage.xaml.cs를
private EventMan man = new EventMan();
public MainPage()
{
this.InitializeComponent();
this.LoadEvents();
}
private void LoadEvents()
{
this.Events = man.GetAllEvents(@"C:\Events Project\events.xml");
}
EventMan.cs
public List<Event> GetAllEvents(string filename)
{
if (filename == null)
{
throw new ArgumentNullException("filename");
}
XDocument document = XDocument.Load(filename);
...
}
많은 도움을 주셔서 감사합니다. – Matt