嗨,我必须将json
数据解析为datatable
对象。贝娄是我的json
数据
{
"Figurative Expressions (Idioms)" : {
"A" : [
{
"One word" : "Above all",
"Phrase" : "chiefly, before everything else"
},
{
"One word" : "Above-board",
"Phrase" : "not open to question, honest, straight-forward, beyond reproach"
},
{
"One word" : "Above-par",
"Phrase" : "of superior quality"
},
{
"One word" : "On account of ",
"Phrase" : "for the sake of"
},
{
"One word" : "On no account",
"Phrase" : "not for any reason"
},
{
"One word" : "To give a good account of oneself",
"Phrase" : "to act with credit to oneself"
}
]
}
}
我们如何解析这些json
数据datatable
?
当我尝试使用 时javascriptserializer
,它被成功解析,但没有得到任何东西datatable
。
JavaScriptSerializer js = new JavaScriptSerializer();
DataTable data1 = js.Deserialize<DataTable>(text);