xml序列化指定xmlelement和xmlattribute一起Given:–[XmlRoot("Book")]publicclassBook{[XmlAttribute]publicstringTitle;[XmlElement]公共字符串发布者;[XmlElement]公共字符串PublisherReference;}SomePublisherXYZ123序列化为XML内容时会给出,如果对你有用,需要了解更多C#学习教程,希望大家多多关注—SomePublisher[XmlRoot("Book")]publicclassBook{[XmlAttribute]publicstringTitle;[XmlElement]公共发布者发布者;}[Serializable]publicclassPublisher{[XmlText]publicstringValue;[XmlAttribute]公共字符串引用;}本文收集自网络,不代表立场。如涉及侵权,请点击右侧联系管理员删除。如需转载请注明出处:
