需要帮助解析特定的JSON



我有这个json字符串:

{
    "Store": [{
        "StoreID": "8643",
        "IsDeliveryStore": true,
        "MinDistance": 0.6,
        "MaxDistance": 0.6,
        "Phone": "352-505-5557",
        "AddressDescription": "3581 sw archer rdnGainesville, FL 32608",
        "HolidaysDescription": "",
        "HoursDescription": "Mo-Fr 9:30am-4:00amnSa-Su 10:00am-4:00am",
        "ServiceHoursDescription": {
            "Carryout": "Mo-Fr 9:30am-4:00amnSa-Su 10:00am-4:00am",
            "Delivery": "Mo-Fr 9:30am-4:00amnSa-Su 10:00am-4:00am"
        },
        "IsOnlineCapable": true,
        "IsOnlineNow": true,
        "IsNEONow": false,
        "IsSpanish": true,
        "LocationInfo": null,
        "LanguageLocationInfo": {
            "es": null
        },
        "AllowDeliveryOrders": true,
        "AllowCarryoutOrders": true,
        "IsOpen": true,
        "ServiceIsOpen": {
            "Carryout": true,
            "Delivery": true
        }
    }, {
        "StoreID": "3214",
        "IsDeliveryStore": false,
        "MinDistance": 2.1,
        "MaxDistance": 2.1,
        "Phone": "352-377-4992",
        "AddressDescription": "3309 W University AvenGainesville, FL 32607nIn Publix Plazza.",
        "HolidaysDescription": "",
        "HoursDescription": "Su-Th 10:00am-3:00amnFr-Sa 10:00am-4:00am",
        "ServiceHoursDescription": {
            "Carryout": "Su-Th 10:00am-3:00amnFr-Sa 10:00am-4:00am",
            "Delivery": "Su-Th 10:00am-3:00amnFr-Sa 10:00am-4:00am"
        },
        "IsOnlineCapable": true,
        "IsOnlineNow": true,
        "IsNEONow": false,
        "IsSpanish": false,
        "LocationInfo": "In Publix Plazza.",
        "LanguageLocationInfo": {
            "es": "In Publix Plazza."
        },
        "AllowDeliveryOrders": true,
        "AllowCarryoutOrders": true,
        "IsOpen": true,
        "ServiceIsOpen": {
            "Carryout": true,
            "Delivery": true
        }
    }, {
        "StoreID": "3172",
        "IsDeliveryStore": false,
        "MinDistance": 2.7,
        "MaxDistance": 2.7,
        "Phone": "352-373-8888",
        "AddressDescription": "5750 SW 75th Ct #40nGainesville, FL 32608nIn Park Lane Plaza  .",
        "HolidaysDescription": "",
        "HoursDescription": "Su-Th 10:00am-1:00amnFr-Sa 10:00am-2:00am",
        "ServiceHoursDescription": {
            "Carryout": "Su-Th 10:00am-1:00amnFr-Sa 10:00am-2:00am",
            "Delivery": "Su-Th 10:00am-1:00amnFr-Sa 10:00am-2:00am"
        },
        "IsOnlineCapable": true,
        "IsOnlineNow": true,
        "IsNEONow": false,
        "IsSpanish": true,
        "LocationInfo": "In Park Lane Plaza  .",
        "LanguageLocationInfo": {
            "es": "In Park Lane Plaza  ."
        },
        "AllowDeliveryOrders": true,
        "AllowCarryoutOrders": true,
        "IsOpen": true,
        "ServiceIsOpen": {
            "Carryout": true,
            "Delivery": true
        }
    }, {
        "StoreID": "5150",
        "IsDeliveryStore": false,
        "MinDistance": 2.9,
        "MaxDistance": 2.9,
        "Phone": "352-373-2337",
        "AddressDescription": "2106 Sw 13th StnGainesville, FL 32608nIn Domino's Plaza.",
        "HolidaysDescription": "",
        "HoursDescription": "Mo-Fr 9:30am-4:00amnSa-Su 10:00am-4:00am",
        "ServiceHoursDescription": {
            "Carryout": "Mo-Fr 9:30am-4:00amnSa-Su 10:00am-4:00am",
            "Delivery": "Mo-Fr 9:30am-4:00amnSa-Su 10:00am-4:00am"
        },
        "IsOnlineCapable": true,
        "IsOnlineNow": false,
        "IsNEONow": false,
        "IsSpanish": false,
        "SubstitutionStore": "3213",
        "LocationInfo": "In Domino's Plaza.",
        "LanguageLocationInfo": {
            "es": "In Domino's Plaza."
        },
        "AllowDeliveryOrders": true,
        "AllowCarryoutOrders": true,
        "IsOpen": true,
        "ServiceIsOpen": {
            "Carryout": true,
            "Delivery": true
        }
    }, {
        "StoreID": "3246",
        "IsDeliveryStore": false,
        "MinDistance": 4.5,
        "MaxDistance": 4.5,
        "Phone": "352-692-2222",
        "AddressDescription": "4620 NW 39th AvenGainesville, FLnLocated at Magnolia Park.",
        "HolidaysDescription": "",
        "HoursDescription": "Su-Th 10:00am-12:00amnFr-Sa 10:00am-1:30am",
        "ServiceHoursDescription": {
            "Carryout": "Su-Th 10:00am-12:00amnFr-Sa 10:00am-1:30am",
            "Delivery": "Su-Th 10:00am-12:00amnFr-Sa 10:00am-1:30am"
        },
        "IsOnlineCapable": true,
        "IsOnlineNow": true,
        "IsNEONow": false,
        "IsSpanish": true,
        "LocationInfo": "Located at Magnolia Park.",
        "LanguageLocationInfo": {
            "es": "Located at Magnolia Park."
        },
        "AllowDeliveryOrders": true,
        "AllowCarryoutOrders": true,
        "IsOpen": true,
        "ServiceIsOpen": {
            "Carryout": true,
            "Delivery": true
        }
    }, {
        "StoreID": "3261",
        "IsDeliveryStore": false,
        "MinDistance": 4.7,
        "MaxDistance": 4.7,
        "Phone": "352-505-6845",
        "AddressDescription": "3000 NW 83rd StreetnGainesville, FL 32606nLocated at the Food Court of Santa Fe College (Bldg R).",
        "HolidaysDescription": "",
        "HoursDescription": "Mo-Fr 8:30am-5:00pmnSa-Su Closed",
        "ServiceHoursDescription": {
            "Carryout": "Mo-Fr 8:30am-5:00pmnSa-Su Closed",
            "Delivery": "Mo-Fr 8:30am-5:00pmnSa-Su Closed"
        },
        "IsOnlineCapable": true,
        "IsOnlineNow": true,
        "IsNEONow": false,
        "IsSpanish": true,
        "LocationInfo": "Located at the Food Court of Santa Fe College (Bldg R).",
        "LanguageLocationInfo": {
            "es": "Located at the Food Court of Santa Fe College (Bldg R)."
        },
        "AllowDeliveryOrders": true,
        "AllowCarryoutOrders": true,
        "IsOpen": true,
        "ServiceIsOpen": {
            "Carryout": true,
            "Delivery": true
        }
    }, {
        "StoreID": "3213",
        "IsDeliveryStore": false,
        "MinDistance": 4.7,
        "MaxDistance": 4.7,
        "Phone": "352-373-5555",
        "AddressDescription": "25 Nw 16th AvenGainesville, FL 32601nOn the north corner of Main Street and NW 16th avenue.",
        "HolidaysDescription": "",
        "HoursDescription": "Su-Th 10:00am-3:00amnFr-Sa 10:00am-4:00am",
        "ServiceHoursDescription": {
            "Carryout": "Su-Th 10:00am-3:00amnFr-Sa 10:00am-4:00am",
            "Delivery": "Su-Th 10:00am-3:00amnFr-Sa 10:00am-4:00am"
        },
        "IsOnlineCapable": true,
        "IsOnlineNow": true,
        "IsNEONow": false,
        "IsSpanish": false,
        "LocationInfo": "On the north corner of Main Street and NW 16th avenue.",
        "LanguageLocationInfo": {
            "es": "On the north corner of Main Street and NW 16th avenue."
        },
        "AllowDeliveryOrders": true,
        "AllowCarryoutOrders": true,
        "IsOpen": true,
        "ServiceIsOpen": {
            "Carryout": true,
            "Delivery": true
        }
    }]
}

我正在尝试解析这一点,这是我的代码:

Dim StoreWrapper = JsonConvert.DeserializeObject(Of StoreWrapper)(html)
Dim AllStores = StoreWrapper.Stores
Results.Text = AllStores(1).StoreID.ToString
Public Class StoreWrapper
    Public Property Store As List(Of Store)
End Class
Public Class Store
Public Property StoreID As String
Public Property IsDeliveryStore As Boolean
Public Property MinDistance As Double
Public Property MaxDistance As Double
Public Property Phone As String
Public Property AddressDescription As String
Public Property HolidaysDescription As String
Public Property HoursDescription As String
'Public Property ServiceHoursDescription As String
Public Property IsOnlineCapable As Boolean
Public Property IsOnlineNow As Boolean
Public Property IsNEONow As Boolean
Public Property IsSpanish As Boolean
Public Property LocationInfo As String
'Public Property LanguageLocationInfo As String
Public Property AllowDeliveryOrders As Boolean
Public Property AllowCarryoutOrders As Boolean
Public Property IsOpen As Boolean
'Public Property ServiceIsOpen As String
End Class

我遇到的错误是:

在locationfinder.exe

中出现了" system.nullReferenceException"类型的例外

附加信息:对象引用未设置为对象的实例。

所需的更改是 Public Property Store As List(Of Store)

谢谢!

相关内容

  • 没有找到相关文章

最新更新