在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
转载自:http://blog.csdn.net/wswqiang/article/details/6783161 using Newtonsoft.Json; using System.Text; StringBuilder sb = new StringBuilder(); string str = "[{ID:'1',Name:'John',Other:[{Age:'21',Sex:'0'}]},{ID:'2',Name:'Good',Other:[{Age:'36',Sex:'1'}]}]"; JavaScriptArray javascript = (JavaScriptArray)JavaScriptConvert.DeserializeObject(str); for (int i = 0; i < javascript.Count; i++ ) { JavaScriptObject obj = (JavaScriptObject)javascript[i]; sb.Append("ID:" + obj["ID"].ToString()); sb.Append("Name:" + obj["Name"].ToString()); JavaScriptArray json = (JavaScriptArray)obj["Other"]; for (int j = 0; j < json.Count; j++){ JavaScriptObject jsonobj = (JavaScriptObject)json[j]; sb.Append("Age:" + jsonobj["Age"].ToString()); sb.Append("Sex:" + jsonobj["Sex"].ToString()); } }
|
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论