Hi is there any way to append data to an existing XML document using XML serializer.
(您好,可以使用XML序列化器将数据附加到现有XML文档中。)
I am currently doing it like this (我目前正在这样做)
string filePath = "Data.xml";
var serializer = new XmlSerializer(typeof(Event));
extWriter writer = new StreamWriter(filePath, true);
serializer.Serialize(writer, event);
This way adds the element like a root node instead of a child node...I also used LINQ to XML that way worked fine but that's way seems hardcoded, is there any way to achieve it using this method.
(这种方式添加了像根节点而不是子节点这样的元素...我也使用LINQ到XML,这种方式可以正常工作,但是这种方式似乎是硬编码的,有什么方法可以使用这种方法来实现。)
ask by mike oconner translate from so 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…