Quantcast
Channel: Community | MonoGame - Latest topics
Viewing all articles
Browse latest Browse all 6821

How to rewrite a XML file in monogame?

$
0
0

@FreedeX_Official wrote:

Hi, I trying to rewrite a xml file in monogame from the code for save the score, but my game crash with this error:
System.UnauthorizedAccessException: Access to the path "/name.xml" is denied.

For write XML file I writed this code:
XMLData.RecordClass data = new XMLData.RecordClass();
data.record = "5";
XmlWriterSettings settings = new XmlWriterSettings();
settings.Indent = true;
using (XmlWriter writer = XmlWriter.Create("name.xml", settings))
{ Microsoft.Xna.Framework.Content.Pipeline.Serialization.Intermediate.IntermediateSerializer.Serialize(writer, data, null);
}

Posts: 1

Participants: 1

Read full topic


Viewing all articles
Browse latest Browse all 6821

Trending Articles