{"result":[{"id":1,"type":"DataParameter.TReaderBaseInfor","fields":{"Msg":"获取成功","CardNo":"19891002","ReaderType":"教师","ReaderSex":"","State":"","BarCode":"19891002","ReaderUnit":"信息网络安全学院","Scores":"0","FINE":"0","ReturnValue":0,"RaderName":"吴建国","PassWord":"Tsg123456."}}]}
这个实体要怎么写?难搞哦
public class Rootobject
{
public Result[] result { get; set; }
}
public class Result
{
public int id { get; set; }
public string type { get; set; }
public Fields fields { get; set; }
}
public class Fields
{
public string Msg { get; set; }
public string CardNo { get; set; }
public string ReaderType { get; set; }
public string ReaderSex { get; set; }
public string State { get; set; }
public string BarCode { get; set; }
public string ReaderUnit { get; set; }
public string Scores { get; set; }
public string FINE { get; set; }
public int ReturnValue { get; set; }
public string RaderName { get; set; }
public string PassWord { get; set; }
}
可以参考一下
使用第三方包不更好吗?比如JSONObject。
SynthesizedOut synthesizedOut= Json.fromJson(SynthesizedOut.class,Json.toJson(list.get(i)) );