c# json对象中含有数组,数组中又含有数组!

大哥们帮我问下,c# json对象中含有数组,数组中又含有数组!?

json对象中含有数组,数组中又含有数组!这不是问题,这些我能解析出来,但是有个巨大的问题,JSOn中数组中有嵌套了多个数组,这些数组没有可以用来检索的东西!!!!这些才问题,..这个是JSON代码这个是我直接读出来的,没有解析。
{"errno":0,"data":{"word_name":"\u597d","symbols":[{"ph_zh":"h\u01ceo","parts":[{"part":"\u5f62","means":["good","fine","nice"]}]},{"ph_zh":"h\u00e0o","parts":[{"part":"\u52a8","means":["like","love","be fond of"]},{"part":"\u540d","means":["a surname"]}]}]},"to":"en","from":"zh"}

我能解析出来,但是我的解析缺是把全部的means和part解析出来了..我想单个解析 而不是全部解析出来
最新回答
被丘比特遗忘的爱゛

2024-11-07 09:59:45

安装Json.net,using Newtonsoft.Json.Linq;
string result = string.Empty;
using (StreamReader sr = new StreamReader(File.Open(@"D:\csharp\output\output\data.json", FileMode.Open)))
{
result = sr.ReadToEnd();
}
JObject jo = (JObject)Newtonsoft.Json.JsonConvert.DeserializeObject(result);
Console.WriteLine(jo["data"]["symbols"][0]["parts"][0]["means"][1].ToString());
Console.ReadLine();

data.json就是存放的
{"errno":0,"data":{"word_name":"\u597d","symbols":[{"ph_zh":"h\u01ceo","parts":[{"part":"\u5f62","means":["good","fine","nice"]}]},{"ph_zh":"h\u00e0o","parts":[{"part":"\u52a8","means":["like","love","be fond of"]},{"part":"\u540d","means":["a surname"]}]}]},"to":"en","from":"zh"}