日期:2014-05-17 浏览次数:20726 次
public class School
{
public int Count;
public Unit[] Items;
}
static void Main(string[] args)
{
string json = @"[{'Count':1543,'Items':{'UnitID':6119,'UnitName':'C'}}]";
List<User> users = JsonConvert.DeserializeObject<List<User>>(json);
foreach (User user in users)
{
Console.WriteLine("UserName:" + user.Count + "UserID:" + user.items.UnitID);
}
}
public class User
{
public int Count { get; set; }
public Items items { get; set; }
}
public class Items
{
public int UnitID { get; set; }