C# Json多功能操作类 第三版
using Jorben.Json; //组合Json字符串 JsonHelper json = new JsonHelper(false); string[] b = [ "a11", "a22", "a33" ]; json.Add("a", "11111"); json.Add("b", b); Response.Write(json.OutString); Response.Write("<br />"); //修改Json键值 json = new JsonHelper(); json.Add("a", "11111"); json.Add("a", "22222"); Response.Write(json.OutString); Response.Write("<br />"); //合并:将Json字符串合并到一起 json = new JsonHelper(false); string tempString = "{\"a33\":{\"888\":\"999\"}}"; json.Add("测试1", "测试11"); json.Merge(tempString); Response.Write(json.OutString); Response.Write("<br />"); //判断某个键是否存在 json = new JsonHelper(false); tempString = "{\"a33\":{\"888\":\"999\"}}"; json.Merge(tempString); Response.Write(json.ContainsKey("a33")); Response.Write("<br />"); //获取某个健值 json = new JsonHelper(false); tempString = "{\"ac\":\"11111\",\"b\":[\"a11\",\"a22\"]}"; json.Merge(tempString); Response.Write(json.Get("ac")); Response.Write("<br />"); //两个Json字符串进行合并 json = new JsonHelper(false); string jsonString = "{\"ac\":\"11111\",\"b\":[\"a11\",\"a22\"]}"; json.Merge(jsonString, tempString); Response.Write(json.OutString); -------------- 此版中增加并调整了很多的功能,比如对表格与Json的转换等等实用性功能 在此后版中会统一出一个工具类并包含对Json的操作类,近请期待~~~ 有任何问题请联系: QQ:6102341 topcoolge@qq.com 功能持久加强中....
- 粉丝: 5
- 资源: 14
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
- 1
- 2
前往页