{
"message": "成功",
"data": {
"limit": 0,
"total": 800,
"start": 20,
"list": [
{
"id": 2405523769,
"messageId": 775101403,
"Create": 1375905233000,
"Modified": 1375928731000,
"Type": 1,
"targetId": 585283801,
"replyStatus": 0
},
{
"id": 2404981245,
"messageId": 774684997,
"Create": 1375752377000,
"Modified": 1375753577000,
"Type": 5,
"targetId": 211093954,
"replyStatus": 1
},
{
"id": 2404977668,
"messageId": 774683839,
"Create": 1375751344000,
"Modified": 1375753576000,
"Type": 5,
"targetId": 211093954,
"replyStatus": 1
},
{
"id": 2404965686,
"messageId": 5591387666,
"Create": 1375746558000,
"Modified": 1375771535000,
"Type": 1,
"targetId": 1103045089,
"replyStatus": 0
},
{
"id": 2404807912,
"messageId": 774551142,
"Create": 1375700412000,
"Modified": 1375750904000,
"Type": 5,
"targetId": 211093954,
"replyStatus": 1
},
{
"id": 2404670958,
"messageId": 774457043,
"Create": 1375666474000,
"Modified": 1375690013000,
"Type": 5,
"targetId": 211093954,
"replyStatus": 1
},
{
"id": 2404665403,
"messageId": 774448434,
"Create": 1375664269000,
"Modified": 1375690014000,
"Type": 5,
"targetId": 211093954,
"replyStatus": 1
},
{
"id": 2404661178,
"messageId": 774446607,
"Create": 1375662580000,
"Modified": 1375667457000,
"Type": 1,
"targetId": 211093954,
"replyStatus": 1
}
]
},
"statuscode": 200,
"filter":false,
"isNull": false
}
JavaScriptSerializer
你建一个和json一模一样的对象就可以deserialize了,非常好用。
http://stackoverflow.com/questions/10741374/json-net-json-to-entity
嵌套类就可以了~~~
注意补全[],
实体是如何定义的?
就是不知道要定义什么样的实体才能使用JSON.NET反序列化,我现在是用JSON.NET分步做的,按层次定义了3个实体,obj,data,list,obj包含data,data包含list集合
@Hawker: 那可以不用实体,用JSON.NET的jObject搞定,参考:Json的序列化问题
json字符串转实体类的,可以用这个工具:http://www.ofmonkey.com/