0
我將集合轉換爲JSON字符串。如何從JSON字符串中獲取值?
ReadOnlyCollection<Post> wall = api.Wall.Get(-group.Id.Value, out totalCount, count);
string json = JsonConvert.SerializeObject(wall, Formatting.Indented);
GET JSON字符串這樣
[
{
"Id": 144159,
"Text": "Если",
"Likes": {
"Count": 9307,
"UserLikes": false,
"CanLike": true,
"CanPublish": true
},
"PostType": "post",
"PostSource": {
"Type": "api",
"Data": null
},
"Attachments": [
{
"Instance": {
"AlbumId": -7,
"Photo75": "http://cs629506.vk.me/v629506780/3a56/Sn3eI5qEtc0.jpg",
"Photo130": "http://cs629506.vk.me/v629506780/3a57/tKRNTJlSH1s.jpg",
"Photo604": "http://cs629506.vk.me/v629506780/3a58/wyz6H7Py_8U.jpg",
},
"Type": "VkNet.Model.Attachments.Photo, VkNet, Version=1.0.16.0, Culture=neutral, PublicKeyToken=null"
}
]
我怎麼可能會從 「Photo604」 的價值?我想要圖片的網址。請幫幫我!
你爲什麼要序列化集合呢?爲什麼不只是得到'wall [0] .Attachments [0] .Instance.Photo604'? –
你可以顯示「Post」類型嗎? –
是的,它是郵政類型 –