的JSON數組我有一個從序列化對象的數組創建一個JSON字符串:如何反序列化對象的C#結構
[
{
"html": "foo"
},
{
"html": "bar"
}
]
如何我可以將它反序列化一些迭代C#結構?我試過這個代碼,但我得到No parameterless constructor defined for type of 'System.String'.
錯誤:
string[] htmlArr = new JavaScriptSerializer().Deserialize<String[]>(html);
我想接收是一個迭代結構得到每個「HTML」對象。
結帳這個以前計算器後,http://stackoverflow.com/questions/3142495/deserialize-json-into -c-sharp-dynamic-object或http://stackoverflow.com/questions/7895105/json-deserialize-c-sharp – MethodMan
感謝您的鏈接,我第一次嘗試這樣做,而不創建額外的類,但我可以離開與它我猜:) –
可能重複的[解析json對象](http://stackoverflow.com/questions/10432647/parsing-json-objects) – nawfal