using System; using System.IO; using System.Text; using System.Xml; using System.Xml.Serialization; namespace ConsoleApplication1 { class Program { static void Main(string[] args) { //序列化 Person person = }; string xml = Serialize(person); Console.Wri…
using System; using System.Collections.Generic; using System.IO; using System.Xml.Serialization; namespace ConsoleApp.Test { public class XmlTest { public void TestXml() { var dept = new Depts { Id = 1, Name = "部门", UserList = new List<Users&…
直接上码: 首先创建class1类 public class Class1 { public string name { get; set; } public int age { get; set; } public bool sex { get; set; } } 实例化class1对象并进行序列化和反序列化 static void Main(string[] args) { //实例化class1类 Class1 c1 = , sex = true }; //序列化(class1为反序列化已…
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Windows; using System.Windows.Controls; using System.Windows.Data; using System.Windows.Documents; using System.Windows.Input; using System.Windows.Med…