【发布时间】:2016-02-13 17:47:42
【问题描述】:
所以我要做的是从 Steams API 中为 dota2 英雄捕获/提取特定数据。我正在使用 C# 使用 this 方法来执行此操作。
{
"result": {
"heroes": [
{
"name": "npc_dota_hero_antimage",
"id": 1,
"localized_name": "Anti-Mage"
},
]
}
这是我一直在尝试的代码:
WebClient c = new WebClient();
var data = c.DownloadString("https://api.steampowered.com/IEconDOTA2_570/GetHeroes/v0001/?key=2D13D618DA712015812E970165632F02&language=en_us");
JObject o = JObject.Parse(data);
string heroname = (string)o["name"];
但它只返回一个错误,说“heroname”的值为空。
有什么想法吗?
【问题讨论】: