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;