C# json解析(多层)怎么遍历

{"resultcode":"200","reason":"成功的返回","result":{"BJ":{"province":"北京","province_code":... {"resultcode":"200","reason":"成功的返回","result":
{"BJ":
{"province":"北京","province_code":"BJ","citys":
[{"city_name":"北京","city_code":"BJ","abbr":"京","engine":"1","engineno":"0","classa":"0","class":"0","classno":"0","regist":"0","registno":"0"}]},
"SH":{"province":"上海","province_code":"SH","citys":[{"city_name":"上海","city_code":"SH","abbr":"沪","engine":"1","engineno":"0","classa":"0","class":"0","classno":"0","regist":"0","registno":"0"}]},
"ZJ":{"province":"浙江","province_code":"ZJ","citys":[{"city_name":"杭州","city_code":"ZJ_HZ","abbr":"浙","engine":"0","engineno":"0","classa":"1","class":"1","classno":"6","regist":"0","registno":"0"},{"city_name":"宁波","city_code":"ZJ_NB","abbr":"浙","engine":"0","engineno":"0","classa":"1","class":"1","classno":"6","regist":"0","registno":"0"},{"city_name":"义乌","city_code":"ZJ_YW","abbr":"浙","engine":"0","engineno":"0","classa":"1","class":"1","classno":"3","regist":"0","registno":"0"}]),"error_code":0}
使用JsonSerializer或者JavaScriptSerializer取每个节点的值
使用对象获取
展开
 我来答
handangaoyang
2015-09-01 · TA获得超过2242个赞
知道大有可为答主
回答量:2633
采纳率:88%
帮助的人:915万
展开全部
想用JavaScriptSerializer,前提条件就是你的json数据要有对应的Domain类。

如果没有,你只能转换为Dictionary,然后在转换。
更多追问追答
追问
我查到JavaScriptSerializer好像有限制的,是否有例子可以参考或者代码
追答
我不明白你现在遇到的问题。你是对JavaScriptSerializer这个类没用过,还是什么?

这个类的使用非常简单。
http://www.cnblogs.com/color-wolf/p/3640261.html
本回答被提问者和网友采纳
已赞过 已踩过<
你对这个回答的评价是?
评论 收起
推荐律师服务: 若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询

为你推荐:

下载百度知道APP,抢鲜体验
使用百度知道APP,立即抢鲜体验。你的手机镜头里或许有别人想知道的答案。
扫描二维码下载
×

类别

我们会通过消息、邮箱等方式尽快将举报结果通知您。

说明

0/200

提交
取消

辅 助

模 式