摘要:
static void Serialize(T instance , string fileName){ using(XmlWriter writer = new XmlWriter(filename , Encoding.UTF8)) { XmlSerializer serializer = new XmlSerializer(typeof(T)); serializer.Serialize(writer , instance); }}Serialize(order , "order.xml"); 阅读全文