求助下C#该怎么解析json
想自己做个积累单词的程序,用json格式来存储数据(以下是自己写的其中一个,txt写的){
"YearningToolCode": "Word",
"RecordVersion": "1.0.0",
"WordInfo": {
"EnglishWord": "victim",
"WordDerivation": "SCBooks"
"ChineseMean": {
"Quantity": 4,
"MeanInfo": {
{
"Property": 0,
"Mean": "受害者,牺牲者"
},
{
"Property": 0,
"Mean": "受骗者,上当的人"
},
{
"Property": 0,
"Mean": "祭品,贡品"
},
{
"Property": 0,
"Mean": "无助者,被动者"
}
},
"WordDeformation": {
"Quantity": 2,
"DefoInfo": {
{
"NewWord": "victimize",
"Property": 1,
"Mean": "使受害;使牺牲;欺骗"
},
{
"NewWord": "victimizer",
"Property": 0,
"Mean": "施害者"
}
}
}
}
}
}
请问我写的这个语法对不对?
在C#中该怎么解析获取各个数据? 已解决,结果:
压缩后:
{"YearningToolCode":"Word","RecordVersion":"1.0.0","WordInfo":{"EnglishWord":"victim","WordDerivation":"TPO Listening","ChineseMean":{"Quantity":4,"MeanInfo":[{"Property":0,"Mean":"受害者,牺牲者"},{"Property":0,"Mean":"受骗者,上当的人"},{"Property":0,"Mean":"祭品,贡品"},{"Property":0,"Mean":"无助者,被动者"}]},"WordDeformation":{"Quantity":2,"DefoInfo":[{"NewWord":"victimize","Property":1,"Mean":"使受害;使牺牲;欺骗"},{"NewWord":"victimizer","Property":0,"Mean":"施害者"}]}}}
格式化后:
{
"YearningToolCode": "Word",
"RecordVersion": "1.0.0",
"WordInfo": {
"EnglishWord": "victim",
"WordDerivation": "TPO Listening",
"ChineseMean": {
"Quantity": 4,
"MeanInfo": [{
"Property": 0,
"Mean": "受害者,牺牲者"
}, {
"Property": 0,
"Mean": "受骗者,上当的人"
}, {
"Property": 0,
"Mean": "祭品,贡品"
}, {
"Property": 0,
"Mean": "无助者,被动者"
}]
},
"WordDeformation": {
"Quantity": 2,
"DefoInfo": [{
"NewWord": "victimize",
"Property": 1,
"Mean": "使受害;使牺牲;欺骗"
}, {
"NewWord": "victimizer",
"Property": 0,
"Mean": "施害者"
}]
}
}
}
页:
[1]