一聚教程网:一个值得你收藏的教程网站

热门教程

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

时间:2022-06-25 04:26:49 编辑:袖梨 来源:一聚教程网

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

热门栏目