我使用过Newtonsoft
JSON.NET(文档),它允许您创建类/对象,填充字段并序列化为JSON。
public class ReturnData { public int totalCount { get; set; } public List<ExceptionReport> reports { get; set; } }public class ExceptionReport{ public int reportId { get; set; } public string message { get; set; } }string json = JsonConvert.SerializeObject(myReturnData);


