내가 가지고있는 다음과 같은 데이터 :JavascriptSerializer 예외
{ "데이터": { "ID": "7IaWnXo", "제목"널 (null), "설명"널 (null), "날짜"1397926970 " false ","width ": 60,"height ": 60,"size ": 1277,"views ": 0,"bandwidth ": 0,"favorite ": false , "nsfw": null, "section": null, "deletehash": "KYIfVnHIWWTPifh", "link": "http://i.imgur.com/7IaWnXo.png"}, "success": true, "status ": 200}
나는 이것으로 그것을 시리얼 라이저 시도하고있다 :
public struct ImageInfoContainer
{
public ImageInfo data {get; set;}
bool success { get; set; }
string status { get; set; }
}
public struct ImageInfo
{
public string id {get; set;}
public string title { get; set; }
public string url { get; set; }
public string description {get; set;}
public string datetime {get; set;}
public string type {get; set;}
public string animated {get; set;}
public int width {get; set;}
public int height {get; set;}
public int size {get; set;}
public int views {get; set;}
public int bandwidth {get; set;}
public bool favourite {get; set;}
public bool nsfw {get; set;}
public string section {get; set;}
public string deletehash {get; set;}
public string link {get; set;}
}
내가 받고 있어요 :
'System.InvalidOperationException'System.Web.Extensions.dll에서 발생했지만 사용자 코드에서 처리되지 않은 유형의 예외
추가 정보 : 널 (null)를 변환 할 수 없습니다 값 형식으로.
내가 뭘 잘못하고 있니?
''nsfw ': null'은'true' 또는'false'이어야합니다. 'section'은 null이 아니어야합니다. – Ofiris