Я пытаюсь загрузить файл JSON на веб-сайт, используя C # и JSON.Net
Однако при запуске он сталкивается с проблемой, поскольку весь JSON находится в [].
Вот JSON:
[{"embed_count":"16","name":"live_user_catreina","stream_count":"133","category":"gaming","format":"live","channel_count":272,"title":"SWTOR - Sith Marauder - L42 - Belsavis - The Fatman","featured":true,"site_count":"117","abuse_reported":false,"channel":{"image_url_large":"http://static-cdn.jtvnw.net/jtv_user_pictures/catreina-profile_image-2c63d1c5b60987da-300x300.jpeg","channel_url":"http://www.justin.tv/catreina","category_title":"Gaming","screen_cap_url_large":"http://static-cdn.jtvnw.net/previews/live_user_catreina-320x240.jpg","mature":null,"subcategory":null,"category":"gaming","image_url_medium":"http://static-cdn.jtvnw.net/jtv_user_pictures/catreina-profile_image-2c63d1c5b60987da-150x150.jpeg","subcategory_title":null,"status":"SWTOR - Sith Marauder - L42 - Belsavis - The Fatman","screen_cap_url_medium":"http://static-cdn.jtvnw.net/previews/live_user_catreina-150x113.jpg","image_url_small":"http://static-cdn.jtvnw.net/jtv_user_pictures/catreina-profile_image-2c63d1c5b60987da-70x70.jpeg","timezone":"US/Eastern","screen_cap_url_small":"http://static-cdn.jtvnw.net/previews/live_user_catreina-70x53.jpg","id":5895485,"views_count":"6142420","embed_enabled":true,"embed_code":" <object type=\"application/x-shockwave-flash\" height=\"295\" width=\"353\" id=\"live_embed_player_flash\" data=\"http://www.justin.tv/widgets/live_embed_player.swf?channel=catreina\" bgcolor=\"#000000\"><param name=\"allowFullScreen\" value=\"true\" /><param name=\"allowscriptaccess\" value=\"always\" /><param name=\"movie\" value=\"http://www.justin.tv/widgets/live_embed_player.swf\" /><param name=\"flashvars\" value=\"start_volume=25&channel=catreina&auto_play=false\" /></object>\n","producer":true,"image_url_tiny":"http://static-cdn.jtvnw.net/jtv_user_pictures/catreina-profile_image-2c63d1c5b60987da-50x50.jpeg","image_url_huge":"http://static-cdn.jtvnw.net/jtv_user_pictures/catreina-profile_image-2c63d1c5b60987da-600x600.jpeg","language":"en","tags":"games gaming lord lotro mmo mmorpg of online pc rings rpg sc2 scii starcraft starcraft2 the vindictus warcraft wow","login":"catreina","screen_cap_url_huge":"http://static-cdn.jtvnw.net/previews/live_user_catreina-630x473.jpg","title":"Gaming With Catreina"},"video_height":720,"language":"en","video_bitrate":1987.1328125,"id":"2309110144","meta_game":"Star Wars: The Old Republic","broadcaster":"fme","broadcast_part":4,"audio_codec":"uncompressed","up_time":"Mon Dec 26 00:06:03 2011","video_width":1280,"geo":"US","channel_view_count":6133751,"channel_subscription":false,"embed_enabled":true,"stream_type":"live","video_codec":"AVC"}]
Я пытаюсь загрузить его с этим кодом:
class Program
{
static void Main(string[] args)
{
WebClient webclient = new WebClient();
var data = webclient.DownloadString("http://api.justin.tv/api/stream/list.json?channel=catreina");
JObject jo = JObject.Parse(data);
Console.WriteLine("Embed Count: " + jo["embed_count"]);
Console.ReadLine();
}
}
Но, очевидно, это дает мне эту ошибку
Необработанное исключение: System.Exception: Ошибка чтения JObject из JsonReader.Текущий элемент JsonReader не является объектом: StartArray
Как загрузить JSON с [], а затем проанализировать значения?