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.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…