asp教程.net3.5 json与.net实体类相互转换
1 网页特效serializer jserializer = new javascriptserializer();
2
3 user user = jserializer.deserialize<user>("{"username":"user","truename":"wange","address":{"city":"beijing","country":"china"},"addresslist":[{"city":"shanghai","country":"china"},{"city":"shijiazhuang","country":"china"}]}");//将json字符串转换为实体类
4
5 stringbuilder stringbuilder=new stringbuilder();
6 jserializer.serialize(user, stringbuilder);//将实体转换为
7
8
时间: 2024-10-25 08:12:50