我在带有C#的asp.net中有一个Facebook应用程序,我在JsonObject
中获得了“教育”的信息。
代码是:
JsonObject basicData = (JsonObject)facebook.Get("me?fields=id,name,email,education");
string id = Convert.ToString(basicData["id"]);
string name = Convert.ToString(basicData["name"]);
string email = Convert.ToString(basicData["email"]);
通过这个我将JsonObject转换为JsonArray:
JsonArray educ = basicData["education"] as JsonArray;
行。我的意图是访问JSON结构的值,但我不知道如何做到这一点! 我试着做以下事情:
for (int i = 0; i < educ.Count; i++)
{
Response.Write(educ[i].ToString());
}
这就是每一行的印象:
{"school":
{"id":"112933022109824",
"name":"Colégio Estadual Antônio de Castro Alves"},
"year":{"id":"138383069535219",
"name":"2005"},
"type":"High School"}