如何将反序列化的json响应填充到excel中?

时间:2016-06-17 17:25:25

标签: c# json excel

这些是我的课程:

public class Rootobject

{
   public Test[] tests { get; set; }
   public Pagination pagination { get; set; }
}

public class Pagination    
{
   public int total_records { get; set; }    
   public int total_pages { get; set; }    
   public int current_page { get; set; }
}

public class Test
{

   public string id { get; set; }
   public string num { get; set; }
   public string name { get; set; }
   public DateTime created { get; set; } 
}

和我反序列化的代码:

var Jsonobject = JsonConvert.DeserializeObject<Rootobject>(jsonText);

Rootobject _obj = (Rootobject)Jsonobject; 


var result = (
from Item in Jsonobject.tests
select new Test    
{
  id = Item.id,
  num = Item.num,
  name = Item.name,
  created = Item.created,     
}).ToList();

我的下一步是将这些填充到excel中。我怎么做?我是初学者,需要一些指导。任何人都可以帮我提出任何建议。谢谢。

0 个答案:

没有答案