C# base64 encoding/decoding with serialization of objects issue

后端 未结 3 1404
[愿得一人]
[愿得一人] 2021-01-13 22:14

I\'m using serialization and deserialization in C# for my Project (which is a Class). They are serialized and saved to an XML file. When loading the Project, all goes well.<

3条回答
  •  隐瞒了意图╮
    2021-01-13 23:00

    Rather than having to worry about encoding, perhaps just use XmlWriter.Create(outPath), and pass that XmlWriter to your serialization code. That will avoid this issue, and other issues (such as having to buffer very large strings for large object graphs). There is an overload that accepts an XmlWriterSettings for finer control.

    XmlWriter is accepted by most xml code.

提交回复
热议问题