读取JSON对象给出错误“预期为int”

时间:2018-10-08 08:31:53

标签: c# json

使用此代码段,我可以接收到一个转换为JSON对象的字符串。

var client = new WebClient { Credentials = new NetworkCredential("USER", "PASSWORD") };
var response = client.DownloadString(@"someURL");

var jo = JObject.Parse(@response);

Console.WriteLine(jo["result"]);
Console.ReadLine();

我的JSON:

enter image description here

我想使用“文本”中的值-我尝试过Console.WriteLine(jo["result"]["text"]);,但它给了我以下错误:

  

System.ArgumentException:“使用无效键值访问的JArray值:“文本”。需要Int32数组索引。”

0 个答案:

没有答案