c# 读取json字符串节点内容

c# 读取json字符串节点内容

string jsonstr = "{\"voiceprompt_callback\": {\"result\": \"1\",\"accept_time\": \"0\"}}";


var ty = JsonConvert.DeserializeObject(jsonstr);

Newtonsoft.Json.Linq.JObject js = ty as Newtonsoft.Json.Linq.JObject;

Newtonsoft.Json.Linq.JToken model = js["voiceprompt_callback"];

string c1 = model["result"].ToString();
string c2 = model["accept_time"].ToString();

 

posted @ 2023-07-13 09:18  gds111789  阅读(400)  评论(0编辑  收藏  举报