我是json的新手。 我有一個數組元素的json。我如何遍歷它以顯示網頁中的內容。json反序列化和C#.net
如何顯示json的內容是這樣labl1.text = Questions[0].questionid;
請幫我在這
的Json
{
"dataObj":{
"surveyId":1,
"questions":[
{
"questionId":7,
"questionName":"Picture can help you tell a better story? Snap a photo and share it with us.",
"questionType":"IMAGE",
"questionSequenceNumber":7,
"pageNo":1,
"highlightedText":"Snap a photo",
"isDynamicText":"N",
"answerOptions":[
{
"parentQuestion":"5",
"parentAnswer":null,
"answerOption":null
}
]
}
]
},
"errorCode":0,
"errorMessage":"No Error"
}
查看[this](http://stackoverflow.com/editing-help)以瞭解如何在SO上使用代碼塊。 –
根據您的json創建類,並使用newtonsoft api將您的json字符串反序列化到這些新創建的類中。其簡單和簡單的方法。 –
@l_raffa,JPBlanc,Sachila Ranawaka,Jakob Christensen,greg-449轉到所有標記爲重複的人,請您提供原始鏈接。它不應該是通常的json反序列化,我已經要求對數組元素進行反序列化。請提供原始問題的鏈接。 –