原文:C#将XML转换成JSON转换XML using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Xml; using Newtonsoft.Json; namespace JSonConverter { class Program { static void Main(string[] args) { string xml = "<Test>
System.Web.Extensions.dll中类JavaScriptSerializer可以帮助我们把C#对象转化为JSON字符串. 有一个Person类 public class Person { private string name; public string Name { get { return name; } set { name = value; } } private int age; public int Age { get { return age; } set {