private void btnTo_Click(object sender, EventArgs e) { StringBuilder sb = new StringBuilder(); string json = dt.ToJson(); sb.AppendLine("ToJson:" + json); MDataTable t = MDataTable.CreateFrom(json); sb.AppendLine("从Josn还原了------------------"); string xml = t.ToXml(); sb.AppendLine("ToXml:" + xml); t = MDataTable.CreateFrom(xml); sb.AppendLine("从Xml还原了--------------------"); sb.AppendLine("还可以和List<T>,Dictionary,ArrayList,HasTable等几乎所有的常用类或数组交互"); rtxtText.Text = sb.ToString(); }