Найти на web странице _total и вывести значение после него в textBox - C#
Формулировка задачи:
Доброе времени суток.
Есть ссылка https://api.twitch.tv/kraken/channels/rolly_khv/follows При переходе по ней через браузер мы получаем:
Как мне найти значение "_total" и вывести в textBox значение 514?
Заранее спасибо.
{"follows":[{"created_at":"2014-12-27T16:01:18Z","_links":{"self":"https://api.twitch.tv/kraken/users/zinger1986/follows/channels/rolly_khv"},"notifications":true,"user":{"_id":71382713,"name":"zinger1986","created_at":"2014-09-17T03:12:20Z","updated_at":"2014-12-17T17:20:06Z","_links":{"self":"https://api.twitch.tv/kraken/users/zinger1986"},"display_name":"Zinger1986","logo":null,"bio":null,"type":"user"}},{"created_at":"2014-12-27T15:23:35Z","_links":{"self":"https://api.twitch.tv/kraken/users/benemortasia/follows/channels/rolly_khv"},"notifications":false,"user":{"_id":77812984,"name":"benemortasia","created_at":"2014-12-23T17:27:44Z","updated_at":"2014-12-24T05:12:23Z","_links":{"self":"https://api.twitch.tv/kraken/users/benemortasia"},"display_name":"Benemortasia","logo":"http://static-cdn.jtvnw.net/jtv_user_pictures/benemortasia-profile_image-6f117b43408a52da-300x300.jpeg","bio":null,"type":"user"}},{"created_at":"2014-12-27T15:21:50Z","_links":{"self":"https://api.twitch.tv/kraken/users/faweres/follows/channels/rolly_khv"},"notifications":false,"user":{"_id":47726448,"name":"faweres","created_at":"2013-08-17T15:46:14Z","updated_at":"2014-12-17T19:24:23Z","_links":{"self":"https://api.twitch.tv/kraken/users/faweres"},"display_name":"Faweres","logo":"http://static-cdn.jtvnw.net/jtv_user_pictures/faweres-profile_image-754535f27c5b6950-300x300.jpeg","bio":"\u044b\u044b","type":"user"}},{"created_at":"2014-12-27T14:56:55Z","_links":{"self":"https://api.twitch.tv/kraken/users/gipster169/follows/channels/rolly_khv"},"notifications":true,"user":{"_id":43950239,"name":"gipster169","created_at":"2013-05-25T15:12:54Z","updated_at":"2014-12-15T13:08:56Z","_links":{"self":"https://api.twitch.tv/kraken/users/gipster169"},"display_name":"Gipster169","logo":null,"bio":null,"type":"user"}},{"created_at":"2014-12-27T14:53:21Z","_links":{"self":"https://api.twitch.tv/kraken/users/psyxopat_proxan/follows/channels/rolly_khv"},"notifications":true,"user":{"_id":70939178,"name":"psyxopat_proxan","created_at":"2014-09-10T17:10:45Z","updated_at":"2014-12-22T16:06:40Z","_links":{"self":"https://api.twitch.tv/kraken/users/psyxopat_proxan"},"display_name":"psyxopat_proxan","logo":null,"bio":"\u043f\u0438\u0441\u044c\u043a\u0438","type":"user "}},{"created_at":"2014-12-27T14:47:58Z","_links":{"self":"https://api.twitch.tv/kraken/users/ghostofhamletfather/follows/channels/rolly_khv"},"notifications":true,"user":{"_id":64924048,"name":"ghostofhamletfather","created_at":"2014-06-23T14:40:19Z","updated_at":"2014-12-27T20:08:28Z","_links":{"self":"https://api.twitch.tv/kraken/users/ghostofhamletfather"},"display_name":"GhostOfHamletFather","logo":null,"bio":null,"type":"user"}},{"created_at":"2014-12-27T14:45:05Z","_links":{"self":"https://api.twitch.tv/kraken/users/flegmat_92/follows/channels/rolly_khv"},"notifications":true,"user":{"_id":72154421,"name":"flegmat_92","created_at":"2014-09-29T10:46:59Z","updated_at":"2014-12-20T09:59:53Z","_links":{"self":"https://api.twitch.tv/kraken/users/flegmat_92"},"display_name":"Flegmat_92","logo":null,"bio":null,"type":"user"}},{"created_at":"2014-12-27T14:23:11Z","_links":{"self":"https://api.twitch.tv/kraken/users/candy_soul/follows/channels/rolly_khv"},"notifications":true,"user":{"_id":77386461,"name":"candy_soul","created_at":"2014-12-17T14:20:04Z","updated_at":"2014-12-17T14:33:40Z","_links":{"self":"https://api.twitch.tv/kraken/users/candy_soul"},"display_name":"Candy_Soul","logo":null,"bio":null,"type":"user"}},{"created_at":"2014-12-27T14:09:08Z","_links":{"self":"https://api.twitch.tv/kraken/users/krampus_ex/follows/channels/rolly_khv"},"notifications":true,"user":{"_id":42239679,"name":"krampus_ex","created_at":"2013-04-08T12:27:25Z","updated_at":"2014-12-24T03:52:28Z","_links":{"self":"https://api.twitch.tv/kraken/users/krampus_ex"},"display_name":"Krampus_Ex","logo":null,"bio":null,"type":"user"}},{"created_at":"2014-12-27T14:06:25Z","_links":{"self":"https://api.twitch.tv/kraken/users/adgloriam1/follows/channels/rolly_khv"},"notifications":false,"user":{"_id":35541569,"name":"adgloriam1","created_at":"2012-08-21T01:28:28Z","updated_at":"2014-12-28T14:17:46Z","_links":{"self":"https://api.twitch.tv/kraken/users/adgloriam1"},"display_name":"AdGloriam1","logo":null,"bio":null,"type":"user"}},{"created_at":"2014-12-27T13:51:32Z","_links":{"self":"https://api.twitch.tv/kraken/users/fiidelec5/follows/channels/rolly_khv"},"notifications":true,"user":{"_id":78087954,"name":"fiidelec5","created_at":"2014-12-27T12:30:08Z","updated_at":"2014-12-27T12:38:39Z","_links":{"self":"https://api.twitch.tv/kraken/users/fiidelec5"},"display_name":"Fiidelec5","logo":null,"bio":null,"type":"user"}},{"created_at":"2014-12-27T13:44:50Z","_links":{"self":"https://api.twitch.tv/kraken/users/blader0000/follows/channels/rolly_khv"},"notifications":true,"user":{"_id":77721944,"name":"blader0000","created_at":"2014-12-22T12:10:39Z","updated_at":"2014-12-26T10:25:05Z","_links":{"self":"https://api.twitch.tv/kraken/users/blader0000"},"display_name":"Blader0000","logo":null,"bio":null,"type":"user"}},{"created_at":"2014-12-27T13:44:31Z","_links":{"self":"https://api.twitch.tv/kraken/users/borua2002/follows/channels/rolly_khv"},"notifications":true,"user":{"_id":53556222,"name":"borua2002","created_at":"2013-12-20T19:42:52Z","updated_at":"2014-12-23T19:15:09Z","_links":{"self":"https://api.twitch.tv/kraken/users/borua2002"},"display_name":"borua2002","logo":null,"bio":null,"type":"user"}},{"created_at":"2014-12-27T13:43:45Z","_links":{"self":"https://api.twitch.tv/kraken/users/sheldonessa/follows/channels/rolly_khv"},"notifications":false,"user":{"_id":71938100,"name":"sheldonessa","created_at":"2014-09-26T04:11:46Z","updated_at":"2014-12-27T13:42:55Z","_links":{"self":"https://api.twitch.tv/kraken/users/sheldonessa"},"display_name":"Sheldonessa","logo":"http://static-cdn.jtvnw.net/jtv_user_pictures/sheldonessa-profile_image-962186a845e96a1c-300x300.jpeg","bio":null,"type":"user"}},{"created_at":"2014-12-27T13:40:48Z","_links":{"self":"https://api.twitch.tv/kraken/users/exo228/follows/channels/rolly_khv"},"notifications":true,"user":{"_id":77645774,"name":"exo228","created_at":"2014-12-21T13:17:44Z","updated_at":"2014-12-23T14:21:43Z","_links":{"self":"https://api.twitch.tv/kraken/users/exo228"},"display_name":"exo228","logo":null,"bio":null,"type":"user"}},{"created_at":"2014-12-27T13:38:02Z","_links":{"self":"https://api.twitch.tv/kraken/users/soularhimaster/follows/channels/rolly_khv"},"notifications":false,"user":{"_id":28184785,"name":"soularhimaster","created_at":"2012-02-12T23:09:39Z","updated_at":"2014-12-22T14:47:10Z","_links":{"self":"https://api.twitch.tv/kraken/users/soularhimaster"},"display_name":"Soularhimaster","logo":null,"bio":null,"type":"user"}},{"created_at":"2014-12-27T13:35:43Z","_links":{"self":"https://api.twitch.tv/kraken/users/death9785/follows/channels/rolly_khv"},"notifications":true,"user":{"_id":67034255,"name":"death9785","created_at":"2014-07-23T14:12:24Z","updated_at":"2014-12-18T15:08:06Z","_links":{"self":"https://api.twitch.tv/kraken/users/death9785"},"display_name":"Death9785","logo":null,"bio":null,"type":"user"}},{"created_at":"2014-12-27T13:34:23Z","_links":{"self":"https://api.twitch.tv/kraken/users/1tailska1/follows/channels/rolly_khv"},"notifications":true,"user":{"_id":74913691,"name":"1tailska1","created_at":"2014-11-10T19:05:01Z","updated_at":"2014-11-13T19:31:21Z","_links":{"self":"https://api.twitch.tv/kraken/users/1tailska1"},"display_name":"1tailska1","logo":null,"bio":null,"type":"user"}},{"created_at":"2014-12-27T13:32:36Z","_links":{"self":"https://api.twitch.tv/kraken/users/fogot007/follows/channels/rolly_khv"},"notifications":false,"user":{"_id":55261192,"name":"fogot007","created_at":"2014-01-19T15:55:42Z","updated_at":"2014-12-27T12:50:16Z","_links":{"self":"https://api.twitch.tv/kraken/users/fogot007"},"display_name":"fogot007","logo":null,"bio":null,"type":"user"}},{"created_at":"2014-12-27T13:32:01Z","_links":{"self":"https://api.twitch.tv/kraken/users/owerlard/follows/channels/rolly_khv"},"notifications":false,"user":{"_id":66981584,"name":"owerlard","created_at":"2014-07-22T20:00:21Z","updated_at":"2014-12-13T13:53:23Z","_links":{"self":"https://api.twitch.tv/kraken/users/owerlard"},"display_name":"OweRLarD","logo":null,"bio":null,"type":"user"}},{"created_at":"2014-12-27T13:30:34Z","_links":{"self":"https://api.twitch.tv/kraken/users/unabsolutely/follows/channels/rolly_khv"},"notifications":true,"user":{"_id":30822589,"name":"unabsolutely","created_at":"2012-05-26T18:10:58Z","updated_at":"2014-12-27T13:30:34Z","_links":{"self":"https://api.twitch.tv/kraken/users/vanderkast"},"display_name":"Vanderkast","logo":null,"bio":null,"type":"user"}},{"created_at":"2014-12-27T13:05:52Z","_links":{"self":"https://api.twitch.tv/kraken/users/darkusblade/follows/channels/rolly_khv"},"notifications":true,"user":{"_id":54755088,"name":"darkusblade","created_at":"2014-01-10T21:28:52Z","updated_at":"2014-12-28T11:24:21Z","_links":{"self":"https://api.twitch.tv/kraken/users/darkusblade"},"display_name":"DarkusBlade","logo":null,"bio":null,"type":"user"}}],"_total":514,"_links":{"self":"https://api.twitch.tv/kraken/channels/rolly_khv/follows?direction=DESC&limit=25&offset=0","next":"https://api.twitch.tv/kraken/channels/rolly_khv/follows?direction=DESC&limit=25&offset=25"}}
Решение задачи: «Найти на web странице _total и вывести значение после него в textBox»
textual
Листинг программы
string source; using (WebClient wb = new WebClient()) { source = wb.DownloadString("https://api.twitch.tv/kraken/channels/rolly_khv/follows"); } Regex r = new Regex(@"_total"".(\d+)"); var match = r.Match(source); Console.WriteLine(match.Groups[1].Value);
ИИ поможет Вам:
- решить любую задачу по программированию
- объяснить код
- расставить комментарии в коде
- и т.д