ashx一般处理程序写接口

2018-09-28  本文已影响155人  哆啦在这A梦在哪

json的处理:
string json = @"[{'phantom':true,'id':'20130717001','data':{'MID':1019,'Name':'aaccccc','Des':'cc','Disable':'启用','Remark':'cccc'}}]";
List<Info> jobInfoList = JsonConvert.DeserializeObject<List<Info>>(json);

        foreach (Info jobInfo in jobInfoList)
        {
            Console.WriteLine("UserName:" + jobInfo.id);
        }
    }
}

public class Info
{
    public string phantom { get; set; }
    public string id { get; set; }
    public data data { get; set; }
}

public class data
{
    public int MID { get; set; }
    public string Name { get; set; }
    public string Des { get; set; }
    public string Disable { get; set; }
    public string Remark { get; set; }
}
上一篇下一篇

猜你喜欢

热点阅读