我試圖使用Newtonsoft.Json來反序列化這個JSON字符串,但我沒有得到所需的輸出。 我的JSON字符串是無法解析這個JSON字符串在C#
[
{
"id": 1,
"key": "Residential Homeowner",
"i18nText": "unknown message code DB_ENUM_UserType_residentialhomeowner",
"i18nKey": "DB_ENUM_UserType_residentialhomeowner"
},
{
"id": 8,
"key": "VAR Dealer \/ Builder",
"i18nText": "unknown message code DB_ENUM_UserType_vardealer\/builder",
"i18nKey": "DB_ENUM_UserType_vardealer\/builder"
},
{
"id": 2,
"key": "Administrator",
"i18nText": "unknown message code DB_ENUM_UserType_administrator",
"i18nKey": "DB_ENUM_UserType_administrator"
},
{
"id": 9998,
"key": "TempGuidUser",
"i18nText": "unknown message code DB_ENUM_UserType_tempguiduser",
"i18nKey": "DB_ENUM_UserType_tempguiduser"
},
{
"id": 9999,
"key": "GuidUser",
"i18nText": "unknown message code DB_ENUM_UserType_guiduser",
"i18nKey": "DB_ENUM_UserType_guiduser"
}
]
我只想鍵的值時,ID = 1的值。通常json以{}
(大括號)開頭,但在這裏它就像[]
(方括號)。我見過很多例子,但都沒有爲我工作。
可能重複http://stackoverflow.com/questions/18192357/deserializing-json-object-array-with-json-淨) – James