62,071
社区成员
发帖
与我相关
我的任务
分享
public class Body
{
public List<investList> investList { get; set; }
public string token { get; set; }
}
public class investList
{
public List<investDetail> investDetail { get; set; }
public int N { get; set; }
public int M { get; set; }
public int bet { get; set; }
public int amount { get; set; }
public int sum { get; set; }
public string time { get; set; }
}
public class investDetail
{
public string event_indexofdate { get; set; }
public string envet_num { get; set; }
public string host_Team { get; set; }
public string juest_Team { get; set; }
public int play_state { get; set; }
public string pay_invset { get; set; }
}
使用Newtonsoft
string json=“{
"userName": "wnn",
"matchNum": "周二006",
"investList": [
{
"Id": "2",
"event_indexofdate": "2014/6/5 10:49:44",
"envet_num": "1177",
"host_Team": "周一005",
"juest_Team": "美 国",
"play_state": 0,
"pay_invset": "2"
},
{
"Id": "2",
"event_indexofdate": "2014/6/5 10:51:15",
"envet_num": "1178",
"host_Team": "周二004",
"juest_Team": "阿尔及",
"play_state": 0,
"pay_invset": "2"
},
{
"Id": "2",
"event_indexofdate": "2014/6/5 10:51:41",
"envet_num": "1179",
"host_Team": "周二006",
"juest_Team": "韩 国",
"play_state": 0,
"pay_invset": "2"
}
],
"N": "1",
"M": "3",
"flowCode": "2014/6/5 10:51:58ssssss",
"token": "wedqwdr",
"bet": "1",
"amount": "1",
"sum": "2.00"
}“;
//按照json的属性建好对应的实体
Body body = JsonConvert.DeserializeObject<Body>(json);