Is Isolated Storage Always Necessary?

前端 未结 1 763
闹比i
闹比i 2020-12-18 07:23

I see alot of examples on how to write data from an app to a file then put it in isolated storage. I do not want to write any data to my xml file, I just simply want to save

相关标签:
1条回答
  • 2020-12-18 08:08

    Include the XML file in your project files in Visual Studio, then in the Properties window make sure Build Action is set to Content and Copy to Output Directory is set to Copy always or Copy if newer. This will include the file in the output XAP file.

    To access this file in code use:

    XDocument doc = XDocument.Load( "path/to/my/file.xml" );
    

    Of course, it doesn't have to be XDocument, you can use any XML reader class similarly.

    0 讨论(0)
提交回复
热议问题