C# winform json字符串转对象问题
JSON字符串信息如下:
"{\"cardBo\":{\"carshipnos\":[{\"cardid\":\"B99QJF297C10\",\"carshipno\":\"苏BC8Z58\",\"createdby\":\"1\",\"createddate\":\"2017-06-01 15:24:14\",\"custid\":\"psm\",\"deltag\":\"0\",\"domain\":\"\",\"id\":\"07mM1U297C10\",\"lastmodifiedby\":\"1\",\"lastmodifieddate\":\"2017-06-01 15:24:14\"},{\"cardid\":\"B99QJF297C10\",\"carshipno\":\"苏BC8Z57\",\"createdby\":\"1\",\"createddate\":\"2017-06-12 17:19:17\",\"custid\":\"psm\",\"deltag\":\"0\",\"domain\":\"\",\"id\":\"Gt24TF1Q3D10\",\"lastmodifiedby\":\"1\",\"lastmodifieddate\":\"2017-06-12 17:19:17\"},{\"cardid\":\"B99QJF297C10\",\"carshipno\":\"苏BC8Z59\",\"createdby\":\"1\",\"createddate\":\"2017-06-12 17:19:02\",\"custid\":\"psm\",\"deltag\":\"0\",\"domain\":\"\",\"id\":\"o04SG11Q3D10\",\"lastmodifiedby\":\"1\",\"lastmodifieddate\":\"2017-06-12 17:19:02\"}],\"iccard\":{\"cardno\":\"be e8 4c 5d \",\"companyid\":\"1m688STP2910\",\"createdby\":\"1\",\"createddate\":\"2017-06-01 15:23:59\",\"custid\":\"psm\",\"deltag\":\"0\",\"domain\":\"\",\"id\":\"B99QJF297C10\",\"lastmodifiedby\":\"1\",\"lastmodifieddate\":\"2017-06-01 15:23:59\",\"remarks\":\"\",\"status\":\"INUSE\"}},\"arrangements\":[],\"company\":{\"bindmessagenumber\":\"13311111111\",\"companyname\":\"无锡公司\",\"contactnumber\":\"13311111111\",\"contactperson\":\"张三\",\"createdby\":\"1\",\"createddate\":\"2017-04-23 14:55:17\",\"custid\":\"psm\",\"deltag\":\"0\",\"domain\":\"\",\"id\":\"1m688STP2910\",\"lastmodifiedby\":\"1\",\"lastmodifieddate\":\"2017-04-23 14:55:17\",\"remarks\":\"备注\",\"subsidiarycompany\":\"无锡公司下属单位\"},\"command\":{\"arrangementid\":\"\",\"cardid\":\"\",\"carshipno\":\"\",\"createdby\":\"\",\"createddate\":\"\",\"custid\":\"\",\"deltag\":\"\",\"domain\":\"\",\"id\":\"\",\"indate\":\"\",\"lastmodifiedby\":\"\",\"lastmodifieddate\":\"\",\"outdate\":\"\",\"remarks\":\"\"},\"status\":\"1\"}\r\n"
下面是我的对象信息:
//计划信息实体类
public class Projectinformation
{
public List<cardBo> cardBo { get; set; }//车辆对象信息
public List<arrangements> arrangements { get; set; }//计划信息
public company company { get; set; }//客户信息
public command command { get; set; }//未知
public int status { get; set; } //请求状态
}
//车辆信息对象
public class cardBo
{
public string cardid { get; set; }//id
public string carshipno { get; set; }//车船号
public string createdby { get; set; }//
public string createddate { get; set; }
public string custid { get; set; }
public string deltag { get; set; }
public string domain { get; set; }
public string id { get; set; }
public string lastmodifiedby { get; set; }
public string lastmodifieddate { get; set; }
}
//计划信息
public class arrangements
{
public string id { get; set; }
public string productid { get; set; }
public string companyid { get; set; }
public string arrangementdate { get; set; }
public int quantity { get; set; }
public int usedquantity { get; set; }
public string status { get; set; }
public string remarks { get; set; }
public string custid { get; set; }
public string domain { get; set; }
public string createdby { get; set; }
public string createddate { get; set; }
public string lastmodifiedby { get; set; }
public string lastmodifieddate { get; set; }
public string deltag { get; set; }
public string companyname { get; set; }
public string productname { get; set; }
}
//客户信息实体类
public class company
{
public string bindmessagenumber { get; set; }
public string companyname { get; set; }
public string contactnumber { get; set; }
public string contactperson { get; set; }
public string createdby { get; set; }
public string createddate { get; set; }
public string custid { get; set; }
public string deltag { get; set; }
public string domain { get; set; }
public string id { get; set; }
public string lastmodifiedby { get; set; }
public string lastmodifieddate { get; set; }
public string remarks { get; set; }
public string subsidiarycompany { get; set; }
}
//未知
public class command
{
public string arrangementid { get; set; }
public string cardid { get; set; }
public string carshipno { get; set; }
public string createdby { get; set; }
public string createddate { get; set; }
public string custid { get; set; }
public string deltag { get; set; }
public string domain { get; set; }
public string id { get; set; }
public string indate { get; set; }
public string lastmodifiedby { get; set; }
public string lastmodifieddate { get; set; }
public string outdate { get; set; }
public string remarks { get; set; }
}
大家看看 改如何转换?谢谢!