mono touch中处理json字符串
来源:互联网 发布:红米清空用户数据99 编辑:程序博客网 时间:2024/06/10 04:17
有不明白的地方欢迎入群 347636249 探讨
需要引用System.Json.dll文件:
private string jonstr=@"{ ""totalCount"": ""11"", ""articleInfoList"": [{ ""Articleid"": ""134"", ""Articletitle"": ""生态农业或成中央农村会议焦点"", ""articleContent"": ""http://xxxxxxxxx/article/padarticle.aspx?id=134"", ""Articlechannel"": ""80"", ""Articlecreatedate"": ""2013/12/6 0:00:00"", ""Articleimg"": """", ""ArticleAuthor"": ""超级管理员"", ""outline"": ""近日,中央就农业生态问题和农业可持续发展模式进行了密集调研,各级地方政府农业部门纷纷成立农村环境督查组对相关项目进行检查。多位权威专家在接受《经济参考报》记者采访时表示,一年一度的中央农村工作会议即将召开,预计生态农业将成为会议的一大焦点。"", ""clicknumber"": ""71"" }, { ""Articleid"": ""130"", ""Articletitle"": ""中纪委今起开展网上党风廉政建设民意调查"", ""articleContent"": ""http://xxxxxxxxxxx/article/padarticle.aspx?id=130"", ""Articlechannel"": ""80"", ""Articlecreatedate"": ""2013/11/8 0:00:00"", ""Articleimg"": ""http://xxxxxxxxxxx/Fwadmin/Images/Attach/20131126151752777.jpg"", ""ArticleAuthor"": ""超级管理员"", ""outline"": """", ""clicknumber"": ""16"" }]}";
说明:上面的json串并不标准,由于是直接复制的json字符串到编辑器中,Xamarin会自动转译,不过不会有影响,这里只是测试,自己测试下就知道,当然标准的json最好了。
private List<ArticleModel> parseJsonData(){JsonValue jv = JsonObject.Parse (jonstr);var rs = (from t in (JsonArray)jv ["articleInfoList"] let r = t as JsonObject select new ArticleModel {Articleid=t["Articleid"],Articletitle = t["Articletitle"],ArticleContent =t["articleContent"],Articlechannel = t["Articlechannel"],Articlecreatedate=t["Articlecreatedate"],Articleimg=t["Articleimg"],ArticleAuthor=t["ArticleAuthor"],Outline=t["outline"],ClickNumber = t["clicknumber"]}).ToList ();return rs;}
0 0
- mono touch中处理json字符串
- mono touch通过引用System.Json.dll处理url请求,转成json字符串
- mono touch中UIAlertView对话框多选项处理
- mono touch后端事件处理
- mono touch中自定义事件
- mono touch中touch触发对象判断
- mono touch并行多任务处理
- mono touch中处理视图过长,输入框被键盘遮挡的问题
- mono touch 中图片的StretchableImage属性
- mono touch中UIProgressView的使用
- mono touch中UISwitch控件的使用
- mono touch中UISegmentedControl控件的使用
- mono touch中,UISlider控件的使用
- mono touch中重置UITableView选中行
- Python中处理JSON字符串
- mono touch中去掉NavigationBar的底部阴影
- mono touch 中使用多个视图和控制器
- UIActivityIndicatorView及mono touch中线程的使用
- qt零碎知识点记录
- 在Ubuntu上安装Qt5.2.0
- meld--Visual diff and merge tool for the GNOME Desktop
- 拓胜第一天,下
- SlidingMenu实现
- mono touch中处理json字符串
- 电阻电容
- 在.Net框架中 C# 实现多线程的同步方法详解
- oc学习之旅:NSArray分割,排序,Block
- C#连接Sqlite
- JNI学习积累之三 - 操作JNI函数以及复杂对象传递
- jQuery.post()函数
- mongoDB非正常关闭后无法启动问题
- Valid Sudoku