我的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中的重複*鍵*,而這個問題似乎在詢問重複的*值* –