http://www.sufeinet.com/plugin.php?id=keke_group

苏飞论坛

 找回密码
 马上注册

QQ登录

只需一步,快速开始

分布式系统框架(V2.0) 轻松承载百亿数据,千万流量!讨论专区 - 源码下载 - 官方教程

HttpHelper爬虫框架(V2.7-含.netcore) HttpHelper官方出品,爬虫框架讨论区 - 源码下载 - 在线测试和代码生成

HttpHelper爬虫类(V2.0) 开源的爬虫类,支持多种模式和属性 源码 - 代码生成器 - 讨论区 - 教程- 例子

查看: 2818|回复: 0

[咨询站长] 这种json如何解析,求帮助

[复制链接]
发表于 2015-2-28 22:33:35 | 显示全部楼层 |阅读模式
1金钱
{
    "Currency": 0,
    "Step": "New",
    "IfExistLC": false,
    "Packages": [
        [
            {
                "Transport": 0,
                "LyId": "0",
                "No": "9C8579",
                "RouteType": 11,
                "Channel": 1,
                "RouteArea": 3,
                "Id": "513635",
                "Type": "A320",
                "IsDiscount": false,
                "DepartureTime": "2015-03-10 13:20:00",
                "Departure": "上海",
                "DepartureStation": "浦东2号航站楼",
                "DepartureCode": "SHA",
                "ArrivalTime": "2015-03-10 17:05:00",
                "Arrival": "曼谷",
                "ArrivalStation": "素万那普国际机场",
                "ArrivalCode": "BKK",
                "Bus": false,
                "IsReturn": false,
                "Stopovers": [],
                "CabinInfos": [
                    {
                        "CabinLevel": 0,
                        "Cabins": [
                            {
                                "CabinId": null,
                                "CabinIntegral": 0,
                                "CabinName": "E",
                                "CabinRemain": 0,
                                "TotalLimit": 0,
                                "CabinType": 0,
                                "CabinPrice": 1300,
                                "CabinPricing": 0,
                                "AirPortFee": 0,
                                "FuelFee": 0,
                                "OtherFee": 0,
                                "CabinBaggage": 0,
                                "Products": [
                                    {
                                        "Must": false,
                                        "ProductCompanyId": 0,
                                        "ProductId": 25,
                                        "ProductName": "商务经济座服务",
                                        "ProductNum": 1,
                                        "ProductMaxNum": 1,
                                        "ProductPrice": 0,
                                        "ProductType": 7,
                                        "ProductCategory": null,
                                        "ProductInfo": "909709",
                                        "AllProductInfo": "[{\"Name\":\"E\",\"Id\":25,\"Info\":909709},

{\"Name\":\"X\",\"Id\":25,\"Info\":909708},{\"Name\":\"Q\",\"Id\":25,\"Info\":909707},{\"Name\":\"M\",

\"Id\":25,\"Info\":909706},{\"Name\":\"L\",\"Id\":25,\"Info\":909705}]",
                                        "Discount": 0,
                                        "SeatId": null,
                                        "SeatNo": null,
                                        "Selected": false,
                                        "DownLoadLink": null,
                                        "IncreaseProductOrderDetailId": null,
                                        "PaymentStatus": 0
                                    }
                                ]
                            }
                        ]
                    },
                    {
                        "CabinLevel": 1,
                        "Cabins": [
                            {
                                "CabinId": null,
                                "CabinIntegral": 0,
                                "CabinName": "R2",
                                "CabinRemain": 0,
                                "TotalLimit": 0,
                                "CabinType": 0,
                                "CabinPrice": 850,
                                "CabinPricing": 0,
                                "AirPortFee": 0,
                                "FuelFee": 0,
                                "OtherFee": 0,
                                "CabinBaggage": 0,
                                "Products": []
                            }
                        ]
                    },
                    {
                        "CabinLevel": 2,
                        "Cabins": [
                            {
                                "CabinId": null,
                                "CabinIntegral": 0,
                                "CabinName": "R4",
                                "CabinRemain": 0,
                                "TotalLimit": 0,
                                "CabinType": 0,
                                "CabinPrice": 450,
                                "CabinPricing": 0,
                                "AirPortFee": 0,
                                "FuelFee": 0,
                                "OtherFee": 0,
                                "CabinBaggage": 0,
                                "Products": []
                            }
                        ]
                    }
                ],
                "SWCabinInfos": []
            }
        ],
        [
            {
                "Transport": 0,
                "LyId": "0",
                "No": "9C8891",
                "RouteType": 11,
                "Channel": 1,
                "RouteArea": 3,
                "Id": "553771",
                "Type": "A320",
                "IsDiscount": false,
                "DepartureTime": "2015-03-10 20:40:00",
                "Departure": "上海",
                "DepartureStation": "浦东2号航站楼",
                "DepartureCode": "SHA",
                "ArrivalTime": "2015-03-11 01:05:00",
                "Arrival": "曼谷",
                "ArrivalStation": "素万那普国际机场",
                "ArrivalCode": "BKK",
                "Bus": false,
                "IsReturn": false,
                "Stopovers": [],
                "CabinInfos": [
                    {
                        "CabinLevel": 0,
                        "Cabins": [
                            {
                                "CabinId": null,
                                "CabinIntegral": 0,
                                "CabinName": "E",
                                "CabinRemain": 0,
                                "TotalLimit": 0,
                                "CabinType": 0,
                                "CabinPrice": 1300,
                                "CabinPricing": 0,
                                "AirPortFee": 0,
                                "FuelFee": 0,
                                "OtherFee": 0,
                                "CabinBaggage": 0,
                                "Products": [
                                    {
                                        "Must": false,
                                        "ProductCompanyId": 0,
                                        "ProductId": 25,
                                        "ProductName": "商务经济座服务",
                                        "ProductNum": 1,
                                        "ProductMaxNum": 1,
                                        "ProductPrice": 0,
                                        "ProductType": 7,
                                        "ProductCategory": null,
                                        "ProductInfo": "1150279",
                                        "AllProductInfo": "[{\"Name\":\"E\",\"Id\":25,\"Info\":1150279},

{\"Name\":\"X\",\"Id\":25,\"Info\":1150278},{\"Name\":\"Q\",\"Id\":25,\"Info\":1150277},{\"Name\":\"M\",

\"Id\":25,\"Info\":1150276},{\"Name\":\"L\",\"Id\":25,\"Info\":1150275}]",
                                        "Discount": 0,
                                        "SeatId": null,
                                        "SeatNo": null,
                                        "Selected": false,
                                        "DownLoadLink": null,
                                        "IncreaseProductOrderDetailId": null,
                                        "PaymentStatus": 0
                                    }
                                ]
                            }
                        ]
                    },
                    {
                        "CabinLevel": 1,
                        "Cabins": [
                            {
                                "CabinId": null,
                                "CabinIntegral": 0,
                                "CabinName": "R2",
                                "CabinRemain": 0,
                                "TotalLimit": 0,
                                "CabinType": 0,
                                "CabinPrice": 850,
                                "CabinPricing": 0,
                                "AirPortFee": 0,
                                "FuelFee": 0,
                                "OtherFee": 0,
                                "CabinBaggage": 0,
                                "Products": []
                            }
                        ]
                    },
                    {
                        "CabinLevel": 2,
                        "Cabins": [
                            {
                                "CabinId": null,
                                "CabinIntegral": 0,
                                "CabinName": "P1",
                                "CabinRemain": 0,
                                "TotalLimit": 0,
                                "CabinType": 0,
                                "CabinPrice": 399,
                                "CabinPricing": 0,
                                "AirPortFee": 0,
                                "FuelFee": 0,
                                "OtherFee": 0,
                                "CabinBaggage": 0,
                                "Products": []
                            }
                        ]
                    }
                ],
                "SWCabinInfos": []
            }
        ]
    ],
    "IfSuccess": "Y",
    "Code": "0",
    "MaxDiscountAmount": null,
    "MaxDiscountRate": null,
    "OtherInfo": null,
    "TargetId": null,
    "CustomText": null
}
------------------------------------------------------------------------------------
public class Products
{
   public int Must { get; set; }
   public int ProductCompanyId { get; set; }
   public int ProductId { get; set; }
   public string ProductName { get; set; }
   public int ProductNum { get; set; }
   public int ProductMaxNum { get; set; }
   public int ProductPrice { get; set; }
   public int ProductType { get; set; }
   public int ProductInfo { get; set; }
   public string AllProductInfo { get; set; }
   public int Discount { get; set; }
   public int Selected { get; set; }
   public int PaymentStatus { get; set; }
}
public class Cabins
{
   public int CabinIntegral { get; set; }
   public string CabinName { get; set; }
   public int CabinRemain { get; set; }
   public int TotalLimit { get; set; }
   public int CabinType { get; set; }
   public int CabinPrice { get; set; }
   public int CabinPricing { get; set; }
   public int AirPortFee { get; set; }
   public int FuelFee { get; set; }
   public int OtherFee { get; set; }
   public int CabinBaggage { get; set; }
   public List<Products> Products { get; set; }
}
public class CabinInfos
{
   public int CabinLevel { get; set; }
   public List<Cabins> Cabins { get; set; }
}
public class Packages
{
   public int Transport { get; set; }
   public int LyId { get; set; }
   public string No { get; set; }
   public int RouteType { get; set; }
   public int Channel { get; set; }
   public int RouteArea { get; set; }
   public int Id { get; set; }
   public string Type { get; set; }
   public int IsDiscount { get; set; }
   public DateTime DepartureTime { get; set; }
   public string Departure { get; set; }
   public string DepartureStation { get; set; }
   public string DepartureCode { get; set; }
   public DateTime ArrivalTime { get; set; }
   public string Arrival { get; set; }
   public string ArrivalStation { get; set; }
   public string ArrivalCode { get; set; }
   public int Bus { get; set; }
   public int IsReturn { get; set; }
   public List<Stopovers> Stopovers { get; set; }
   public List<CabinInfos> CabinInfos { get; set; }
   public List<SWCabinInfos> SWCabinInfos { get; set; }
}
public class Root
{
   public int Currency { get; set; }
   public string Step { get; set; }
   public int IfExistLC { get; set; }
   public List<Packages> Packages { get; set; }
   public string IfSuccess { get; set; }
   public int Code { get; set; }
}



已经生成了实体类,求帮助




1. 开通SVIP会员,免费下载本站所有源码,不限次数据,不限时间
2. 加官方QQ群,加官方微信群获取更多资源和帮助
3. 找站长苏飞做网站、商城、CRM、小程序、App、爬虫相关、项目外包等点这里
您需要登录后才可以回帖 登录 | 马上注册

本版积分规则

QQ|手机版|小黑屋|手机版|联系我们|关于我们|广告合作|苏飞论坛 ( 豫ICP备18043678号-2)

GMT+8, 2024-5-16 06:18

© 2014-2021

快速回复 返回顶部 返回列表