当前位置:编程学习 > C#/ASP.NET >>

将以下JSON转换成.net类(微博JSON数据)

{"statuses":[{"created_at":"Thu Dec 06 09:36:45 +0800 2012","id":3520171731567085,"mid":"3520171731567085","idstr":"3520171731567085","text":"我在使用#暖暖牵挂#,快来看看吧","source":"<a href=\"http://app.weibo.com/t/feed/m9oIw\" rel=\"nofollow\">未通过审核应用</a>","favorited":false,"truncated":false,"in_reply_to_status_id":"","in_reply_to_user_id":"","in_reply_to_screen_name":"","thumbnail_pic":"http://ww2.sinaimg.cn/thumbnail/a6731ccejw1dzjr908811j.jpg","bmiddle_pic":"http://ww2.sinaimg.cn/bmiddle/a6731ccejw1dzjr908811j.jpg","original_pic":"http://ww2.sinaimg.cn/large/a6731ccejw1dzjr908811j.jpg","geo":null,"user":{"id":2792561870,"idstr":"2792561870","screen_name":"mxlzlh","name":"mxlzlh","province":"32","city":"4","location":"江苏 常州","description":"","url":"","profile_image_url":"http://tp3.sinaimg.cn/2792561870/50/0/1","profile_url":"u/2792561870","domain":"","weihao":"","gender":"m","followers_count":46,"friends_count":0,"statuses_count":53,"favourites_count":0,"created_at":"Wed May 02 14:11:10 +0800 2012","following":false,"allow_all_act_msg":false,"geo_enabled":true,"verified":false,"verified_type":-1,"remark":"","allow_all_comment":true,"avatar_large":"http://tp3.sinaimg.cn/2792561870/180/0/1","verified_reason":"","follow_me":false,"online_status":0,"bi_followers_count":0,"lang":"zh-cn","star":0,"mbtype":0,"mbrank":0,"block_word":0},"reposts_count":3,"comments_count":0,"attitudes_count":0,"mlevel":0,"visible":{"type":0,"list_id":0}}],"marks":[],"hasvisible":false,"previous_cursor":0,"next_cursor":0,"total_number":53}
--------------------编程问答-------------------- 用json.net --------------------编程问答-------------------- json 类库 --------------------编程问答--------------------
http://blog.csdn.net/xylinzai_xy/article/details/5907610 --------------------编程问答--------------------


        public static Dictionary<string, object> Json2Obj(string txt)
        {
            JavaScriptSerializer serializer = new JavaScriptSerializer();
            Dictionary<string, object> json = (Dictionary<string, object>)serializer.DeserializeObject(txt);
            return json;
        }
--------------------编程问答--------------------


string getUserInfo="{\"isSuccess\":\"OK\"}";
            Dictionary<string, object> userInfo = Json2Obj(getUserInfo);
string val = userInfo["isSuccess"].ToString();
--------------------编程问答-------------------- 推荐json.net。 --------------------编程问答-------------------- 除 --------------------编程问答-------------------- json.net  嘛
补充:.NET技术 ,  C#
CopyRight © 2022 站长资源库 编程知识问答 zzzyk.com All Rights Reserved
部分文章来自网络,