需要json代码来获取数组和非数组值

人气:622 发布:2022-09-22 标签: asp.net json ASP.NET

问题描述

Hi sir,
       I Need json code to get both the array and nonarray values like below. Please give me the code to learn. I tried one code but i am getting only array values, i dont know how to get both the array and non array values. Kindly give me the solution for this problem.


{
    "products": [
        {
            "pid": "1",
            "name": "iPhone 4S",
            "price": "300.00",
            "created_at": "2012-04-29 02:04:02",
            "updated_at": "0000-00-00 00:00:00"
        },
        {
            "pid": "2",
            "name": "Macbook Pro",
            "price": "600.00",
            "created_at": "2012-04-29 02:04:51",
            "updated_at": "0000-00-00 00:00:00"
        },
        {
            "pid": "3",
            "name": "Macbook Air",
            "price": "800.00",
            "created_at": "2012-04-29 02:05:57",
            "updated_at": "0000-00-00 00:00:00"
        },
        {
            "pid": "4",
            "name": "OS X Lion",
            "price": "100.00",
            "created_at": "2012-04-29 02:07:14",
            "updated_at": "0000-00-00 00:00:00"
        }
    ],
    "success": 1
}

推荐答案

ASP.NET中的JSON序列化和反序列化 [ ^ ]

875