当我尝试在c#程序中通过错误“从JsonReader读取JObject时出错”时,我有一些文本。当前JsonReader项不是对象:字符串。路径'',第1行,第6位“
文本:
"data":[{"username":"sex","bio":"#u24e2kyu24d4u24e7pressionsninstagramsex@gmail.com","website":"","profile_picture":"http://images.ak.com/profiles/profile_37086_75sq_1363954517.jpg","full_name":"sex","id":"37086"}]
我的代码:
JObject obj = JObject.Parse(text);
我想在解析为JSON
时获取用户名值答案 0 :(得分:0)
我会在整个字符串周围添加一个{ }
。
即。将文字更改为:
{"data":[{"username":"sex","bio":"#u24e2kyu24d4u24e7pressionsninstagramsex@gmail.com","website":"","profile_picture":"http://images.ak.com/profiles/profile_37086_75sq_1363954517.jpg","full_name":"sex","id":"37086"}]}