怎么将以下json数据转成list集合?
{"user_info_list":[{"subscribe":1,"openid":"otvxTs4dckWG7imySrJd6jSi0CWE","nickname":...
{
"user_info_list": [
{
"subscribe": 1,
"openid": "otvxTs4dckWG7imySrJd6jSi0CWE",
"nickname": "iWithery",
"sex": 1,
"language": "zh_CN",
"city": "Jieyang",
"province": "Guangdong",
"country": "China",
"headimgurl": "http://wx.qlogo.cn/mmopen/xbIQx1GRqdvyqkMMhEaGOX802l1CyqMJNgUzKP8MeAeHFicRDSnZH7FY4XB7p8XHXIf6uJA2SCunTPicGKezDC4saKISzRj3nz/0",
"subscribe_time": 1434093047,
"unionid": "oR5GjjgEhCMJFyzaVZdrxZ2zRRF4",
"remark": "",
"groupid": 0
},
{
"subscribe": 1,
"openid": "otvxTs4dckWG7imySrJd6jSi0CWE",
"nickname": "sssaa",
"sex": 1,
"language": "zh_CN",
"city": "Jieyssang",
"province": "Guangdong",
"country": "China",
"headimgurl": "",
"subscribe_time": 14343093047,
"unionid": "oR5GjjgEhCMJFyzaVZdrxZ2zRRF4",
"remark": "ssssss",
"groupid": 0
},
{
"subscribe": 0,
"openid": "otvxTs_JZ6SEiP0imdhpi50fuSZg",
"unionid": "oR5GjjjrbqBZbrnPwwmSxFukE41U",
}
]
}
这是微信公众平台 获取用户的信息得到的json数据,怎么将其解析成list集合 展开
"user_info_list": [
{
"subscribe": 1,
"openid": "otvxTs4dckWG7imySrJd6jSi0CWE",
"nickname": "iWithery",
"sex": 1,
"language": "zh_CN",
"city": "Jieyang",
"province": "Guangdong",
"country": "China",
"headimgurl": "http://wx.qlogo.cn/mmopen/xbIQx1GRqdvyqkMMhEaGOX802l1CyqMJNgUzKP8MeAeHFicRDSnZH7FY4XB7p8XHXIf6uJA2SCunTPicGKezDC4saKISzRj3nz/0",
"subscribe_time": 1434093047,
"unionid": "oR5GjjgEhCMJFyzaVZdrxZ2zRRF4",
"remark": "",
"groupid": 0
},
{
"subscribe": 1,
"openid": "otvxTs4dckWG7imySrJd6jSi0CWE",
"nickname": "sssaa",
"sex": 1,
"language": "zh_CN",
"city": "Jieyssang",
"province": "Guangdong",
"country": "China",
"headimgurl": "",
"subscribe_time": 14343093047,
"unionid": "oR5GjjgEhCMJFyzaVZdrxZ2zRRF4",
"remark": "ssssss",
"groupid": 0
},
{
"subscribe": 0,
"openid": "otvxTs_JZ6SEiP0imdhpi50fuSZg",
"unionid": "oR5GjjjrbqBZbrnPwwmSxFukE41U",
}
]
}
这是微信公众平台 获取用户的信息得到的json数据,怎么将其解析成list集合 展开
2个回答
展开全部
建立对应实体类,将json字符串序列化成对象
//注:主类名默认Root,可修改.
public class UserInfoList
{
public int subscribe { get; set; }
public string openid { get; set; }
public string nickname { get; set; }
public int sex { get; set; }
public string language { get; set; }
public string city { get; set; }
public string province { get; set; }
public string country { get; set; }
public string headimgurl { get; set; }
public long subscribe_time { get; set; }
public string unionid { get; set; }
public string remark { get; set; }
public int groupid { get; set; }
}
public class Root
{
public IList<UserInfoList> user_info_list { get; set; }
}
这是c#的
haojson点com/json2csharp/ 这个网址 可以在线json字符串生成实体类
2015-10-27
展开全部
呃,那个,这就是你的所有数据了?
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询