WP7中解析json中的数组,怎么把json里的数据转为数组
"categories":[{
"category": "111",
"items":[
{"name": "0","number": ["000"],"image_url":"","html_url":""},
{"name": "1","number": ["111"],"image_url":"","html_url":""},
{"name": "2","number": ["222"],"image_url":"","html_url":""},
{"name": "3","number": ["333"],"image_url":"","html_url":""}
]
}
例如这个:items是一个数组 怎么把它转为数组解析出来。。。或者怎样才能获取到json里面items数组的长度 --------------------编程问答--------------------
--------------------编程问答-------------------- 你好 我是想用C#的 来解析 不要用JS的 能写C#的吗 --------------------编程问答-------------------- 你首先要定义一个用来承载解析结果的实体class,然后就直接调用语句反序列化代码就行了。 --------------------编程问答-------------------- 各位我已经自己搞定了 麻烦了 谢谢 --------------------编程问答-------------------- 恭喜+jf~
var x={"categories":[
{
"category": "111",
"items":[
{"name": "0","number": ["000"],"image_url":"","html_url":""},
{"name": "1","number": ["111"],"image_url":"","html_url":""},
{"name": "2","number": ["222"],"image_url":"","html_url":""},
{"name": "3","number": ["333"],"image_url":"","html_url":""}
]
}]};
alert(x.categories[0].items.length);
补充:.NET技术 , C#