json格式数据转化成List集合

string jsonArrayText1 = "[{'a':'a1','b':'','time':''}]";
JavaScriptSerializer ser = new JavaScriptSerializer();
List<user> list = ser.Deserialize<List<user>>(jsonArrayText1);

 

 

user类序列化

 

[Serializable]
public class user
{
public user()
{ }
[XmlElement("a")]
public string a { get; set; }
[XmlElement("b")]
public string b { get; set; }
[XmlElement("time")]

public DateTime time { get; set; }
}

posted @ 2013-09-12 09:28  木子羊羽  阅读(3719)  评论(0编辑  收藏  举报