- 此问题在此处已有答案**:
Deserialize json object with dynamic items in C#(1个答案)
Using JSON.NET to read a dynamic property name(1个答案)
Complicated Json to C# Object Deserialize with classes(2个答案)
3天前关闭.
"user": {
"1330789870659362817": {
"id": "xxxxxxxxxxxxxxxxxx",
"created_timestamp": "1606120016282",
"name": "yyyyyyyyyyyyy",
"screen_name": "wwwwwwwww",
"protected": false,
"verified": false,
"followers_count": 9,
"friends_count": 23,
"statuses_count": 368,
"profile_image_url": "qqqqqqqqqqqqqqqq",
"profile_image_url_https": "sssssssss"
},
"1467799120933003275": {
"id": "wwwwwwwww",
"created_timestamp": "1638785572496",
"name": "cccccccccccc",
"screen_name": "xxxxxxxxxxxx",
"location": "xxxxxxxx",
"description": "Cricket",
"protected": false,
"verified": false,
"followers_count": 1,
"friends_count": 4,
"statuses_count": 37,
"profile_image_url": "xxxxxx",
"profile_image_url_https": "xxxxxxxxx"
}
}
我希望使用类反序列化该json,当另一个请求带有其他编号(如_5838364784684847657)时,每个请求都应可接受
1条答案
按热度按时间x4shl7ld1#
可以反序列化为
RootObject
对象,该对象将字典作为成员。我使用NewtonSoft.Json进行反序列化。