我试图使用http://www.codeplex.com/Json从JSON对象中提取值。
我使用imdbapi.com,它们返回的JSON如下:
{"Title": "Star Wars", "Year": "1977", "Rated", "PG", "Released", "25 May 1977", "Genre", "Action, Adventure, Fantasy, Sci-Fi "" Director ":" George Lucas "," Writer "," George Lucas "," Actors ":" Mark Hamill, Harrison Ford, Carrie Fisher, Alec Guinness, "" Plot ":" Luke Skywalker leaves his home planet, teams up With Other Rebels, and Tries to save Princess Leia from the evil clutch of Darth hrs 1 min "," Rating ":" 8.8 "," Votes ":" 397318 "," ID ":" tt0076759 "," Response ":" True "}
如何获取电影的标题、评分和年份信息,并将其保存到对象中?
这行代码返回正确的 JSON:
JObject jObject = JObject.Parse (json);
现在我只需要帮忙挑选我想要的数据。有什么建议吗?
o.ContainsKey("Name")
。 - Mo Zaatar