我的JSON文件中的重复值:如何检查和抛出一个异常,如果在JSON文件中存在
[
{
"nome": "Marcos",
"pontos": 12,
"acesso": "2016-04-22T21:10:00.2874904-03:00"
},
{
"nome": "Felipe",
"pontos": 12,
"acesso": "2016-04-22T21:10:00.2904923-03:00"
},
{
"nome": "Augusto",
"pontos": 15,
"acesso": "2016-04-22T21:10:00.2909925-03:00"
},
{
"nome": "Augusto",
"pontos": 12,
"acesso": "2016-04-22T21:10:00.2909925-03:00"
}
]
的“诺姆”值都必须是唯一的;我应该做哪种扫描?浏览数组并比较,看看它是否已经存在?我目前正在使用Newtonsoft.Json;有没有帮助功能?
此问题已被回答之前http://stackoverflow.com/questions/3877526/json-net-newtonsoft-json-two-properties-with-same-name http://stackoverflow.com/questions/12806080/json-net-catching-duplicates-and-throw-an-error – JazzCat
@JazzCat这些问题处理JSON中的重复*键*,而这个问题似乎在询问重复的*值* –