1
我有一個C#類:轉換unwellformatted JSON到C#類
public class JsonAttachmentModel
{
public Guid AttachmentId { get; set; }
public string FileName { get; set; }
public string ExtentionName { get; set; }
}
,我檢索JSON是unwellformatted,它是完全在一個字符串,如:
{"success":false,"message":"The remote server returned an unexpected response: (413) Request Entity Too Large."},
{"success":true,"attachmentId":"dba60830-46fd-4f51-9cd5-3c20df03988d","fileName":"bz1_20121206113251.PNG","extentionName":".PNG"},
{"success":true,"attachmentId":"3cae3f50-7d70-4183-9a69-80cb6d619dbd","fileName":"bz2_20121206113251.PNG","extentionName":".PNG"},
{"success":true,"attachmentId":"b6c8a524-4f46-4a7a-bcda-70042cb4ca92","fileName":"IammorethanOneKb123_20121206113251.txt","extentionName":".txt"},
{"success":true,"attachmentId":"994dfb9c-a185-4c51-b1f4-1017f991740d","fileName":"Iamonekb_20121206113251.txt","extentionName":".txt"}
所以,我的問題是:
我怎樣才能把這個字符串轉換List<JsonAttachmentModel>
,與只匹配「成功」的項目:真正
使用JSON.NET .... –