0
        WebClient client = new WebClient();
        string json_response = client.DownloadString("https://tr.api.pvp.net/api/lol/tr/v1.4/summoner/by-name/SUMMONERNAME?api_key=KEY");
        dynamic deserialized_response = JsonConvert.DeserializeObject<dynamic>(json_response);
        string Summonerid = deserialized_response.id;

嗨,我想只打电话给 id 但我失败了。我也尝试用 viewmodel 来做到这一点,但我仍然失败了。而且我还想创建一个变量 SUMMONERNAME 我怎样才能有一个文本框输入到 SUMMONERNAME。这是 api 的参考链接“ https://developer.riotgames.com/api/methods#!/1079/3722

        string json_response = client.DownloadString("https://tr.api.pvp.net/api/lol/tr/v1.4/summoner/by-name/SUMMONERNAME?api_key=KEY");
        RiotApiViewModel deserialized_response = JsonConvert.DeserializeObject<RiotApiViewModel>(json_response);
        long id = deserialized_response.id;
4

1 回答 1

0

var foundSummoner = JsonConvert.DeserializeObject>(json_response); 这是修复我的错误

于 2016-06-26T19:08:41.600 回答