使用Newtonsoft将JSON反序列化为.NET对象(或者LINQtoJSON?)
WebClient client = new WebClient();Stream stream = client.OpenRead(" StreamReader reader = new StreamReader(stream);List<string> list = Newtonsoft.Json.JsonConvert.DeserializeObject<List<string>>(reader.Read(). ToString());foreach (string item in list){ Console.WriteLine(item);}//Console.WriteLine(reader.ReadLine());stream.Close();
{ "page": 1, "total_pages": 8, "total_entries": 74, "q": "muse", "albums": [ { "name": "Muse", "permalink": "Muse", "cover_image_url": "http://image.kazaa.com/images/69/01672812 1569/Yaron_Herman_Trio/Muse/Yaron_Herman_Trio-Muse_1.jpg", "id": 93098, "artist_name": "Yaron Herman Trio" }, { "name": "Muse", "permalink": "Muse", "cover_image_url": "htt p://image.kazaa.com/images/54/888880301154/Candy_Lo/Muse/Candy_Lo-Muse_1.jpg", "i d": 102702, "artist_name": "\u76e7\u5de7\u97f3" }, { "name": "Absolution", "permalink": " Absolution", "cover_image_url": "http://image.kazaa.com/images/65/093624873365/Mus e/Absolution/Muse-Absolution_1.jpg", "id": 48896, "artist_name": "Muse" }, { "name": "Ab solution", "permalink": "Absolution-2", "cover_image_url": "http://image.kazaa.com/i mages/20/825646911820/Muse/Absolution/Muse-Absolution_1.jpg", "id": 118573, "artist _name": "Muse" },
相关分类