sdata_xml = "{\"body\":\"{\\\"SN_APPLY\\\":[{\\\"MEID_OUI\\\":\\\"99001129\\\"},{\\\"MEID_OUI\\\":\\\"89001129\\\"}],\\\"LIFNR\\\":\\\"107061\\\"}\",\"header\":{\"appid\":\"AC.101\",\"sign\":\"3AD65348606BC\"}}";
JObject jsonObj1 = JObject.Parse(sdata_xml);
body = jsonObj1["body"].ToString();
header = jsonObj1["header"].ToString();
--转换header对象
BackHeader bheader = JsonConvert.DeserializeObject<BackHeader>(header);
转换body对象
BackBody bbody = JsonConvert.DeserializeObject<BackBody>(body);
List<SN_APPLY> list = bbody.SN_APPLY;
构建的实例对象
public class BackHeader
{
public string appid { get; set; }
public string sign { get; set; }
}
public class BackBody
{
public List<SN_APPLY> SN_APPLY { get; set; }
public string LIFNR { get; set; }
}
public class SN_APPLY
{
public string MEID_OUI{ get; set; }
}