我们正在寻找一个支持编组和解组的库,就像Java中的JAX-B一样,是否有任何最先进的库可供使用?
We are searching for an Library which supports the marshalling and unmarshalling like JAX-B in Java, is there any state-of-the-art library to use?
最满意答案
就像Bruno说的那样,你正在寻找的是System.Xml.Serialization命名空间,更具体地说是XmlSerializer类。 要将对象序列化为XML,只需要调用Serialize方法,反过来可以使用Deserialize方法。 有关更多信息,请查看MSDN主题XML序列化简介 。
在序列化为XML时,如果遇到问题,请务必检查(并参与) 此线程 , 这有时会遇到麻烦。
Like Bruno said, what you're looking for is in the System.Xml.Serialization namespace, more specifically the XmlSerializer class. To serialize an object into XML, you just need to call the Serialize method, and the reverse can be done with the Deserialize method. For more information, have a look at the MSDN topic Introducing XML Serialization.
You can sometimes hit a snag when serializing to XML, if you're having trouble be sure to check out (and contribute to) this thread.
更多推荐
发布评论