var jsonString={"BillDate":1,"TypeName":0,"StepNum":0,"CollectCode":0,"Uncollected":1,"Tax":0,"AbstractInfo":1}
现在我们要对这它进行转化并遍历读取:
/// <summary>
/// 把json字符串转化为对象
/// </summary>
/// <param name="Json"></param>
/// <returns></returns>
public static JObject ToJObject(this string Json)
{
return Json == null ? JObject.Parse("{}") : JObject.Parse(Json.Replace(" ", ""));
}
var objData=jsonString.ToJObject();
foreach(var m in objData)
{
var aa = m.Key;
var bb = m.Value;
}
标签:objData,C#,ToJObject,Json,JObject,json,var,序列化 From: https://blog.51cto.com/u_176133/8003329