Asp.net3.5 Json与.net实体类相互转换

作者:袖梨 2022-06-25

asp教程.net3.5 json与.net实体类相互转换

1 网页特效serializer jserializer = new javascriptserializer();
2
3 user user = jserializer.deserialize("{"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

相关文章

精彩推荐