我已经发布了如何反序列化在C#中的json但这是我的问题:C#:asp.net 3.5:反序列化JSON - json字符串或对象?
我得到这个JSON字符串:
data = @"[{""ShiftID"":""2"",""EmpName"":""dsdsfs""},{""ShiftID"":""4"",""EmpName"":""dsdsfd""}]";
和我的代码可以完全反序列化,但很好,如果我收到这种类型:
data = @"[{
"Q6Option": null,
"Q5Comments": "",
"EndDate": "01/17/2012 12:57",
"Q4Comments": "",
"Active": 1,
"Q3Comments": "",
"Q8Option": null,
"Q2Comments": "",
"StartDate": "01/17/2012 12:57",
"Q3Option": null,
"Q5Option": null,
"Q1Comments": "",
"Q2Option": null,
"Station": "B1",
"Q7Option": null,
"SyncDate": null,
"ID": 1,
"Q8Comments": "",
"Q4Option": null,
"ShiftID": 1,
"EmpName": "CSM FName",
"Q1Option": null,
"Q7Comments": "",
"SyncStatus": 0,
"Q6Comments": "",
"EmpID": "111",
"createdAt": "2012-01-17T20:58:17.956Z",
"updatedAt": "2012-01-17T20:58:17.956Z",
"objectId": "XERFM5KrGv"
}]"
它不工作,因为那里缺少“” ..
那么如果你有一个想法,谢谢!
问题是什么? – 2012-03-15 03:03:16
你使用哪个工具来反序列化/序列化? – Mathieu 2012-03-15 03:13:41
问题可能是由于'StartDate' /'EndDate'值 - .NET中的JSON串行器期望以特定的方式格式化日期/时间! – VinayC 2012-03-15 05:06:59