I'm trying to read a Json string in C#, but I'm having trouble figuring out just how to parse the string into C#. Say I have the following Json string
[
{
"AppName": {
"Description": "Lorem ipsum dolor sit amet",
"Value": "1"
},
"AnotherAppName": {
"Description": "consectetur adipisicing elit",
"Value": "String"
},
"ThirdAppName": {
"Description": "sed do eiusmod tempor incididunt ut labore et dolore magna aliqua",
"Value": "Text"
},
"Application": {
"Description": "Ut enim ad minim veniam",
"Value": "100"
},
"LastAppName": {
"Description": "quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat",
"Value": "ZZZ"
}
}
]
I want to parse that into an arraylist or dictionary, using a format like
descriptionList["AppName"] = "Lorem ipsum dolor sit amet";
valueList["AppName"] = "1";
I've been toying around with Json.Net but the examples I've seen don't give me a clear idea of how I should do this. What's the best way to achieve this? Cant this be done like in jQuery, using a foreach statement?
Question&Answers:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…