赞
踩
Newtonsoft.Json.JsonConvert.SerializeObject(dTOs);
- List<students> list= new List<students>();
- list= JSONStringToList<students>(list);
- public static List<T> JSONStringToList<T>(string JsonStr)
- {
- JavaScriptSerializer Serializer = new JavaScriptSerializer();
- //设置转化JSON格式时字段长度
- List<T> objs = Serializer.Deserialize<List<T>>(JsonStr);
- return objs;
- }
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。