using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Newtonsoft.Json;
using System.Web.Script.Serialization;
using System.Collections;
namespace 字典Demo
{
public partial class WebForm1 : System.Web.UI.Page
{
public string json = "{\"dataSet\":{\"header\":{\"returnCode\":\"0\",\"errorInfo\":\"HTTP请求错误\",\"version\":\"V1.0R010\",\"totalRows\":\"2000\",\"returnRows\":\"20\",\"ImageUrl\":\"http://img.baidu.com/img/logo-zhidao.gif\"},\"fieldDefine\":{\"assetId\":\"bloodstrike\",\"serverIdcId\":\"int\",\"inputTime\":\"datetime\"},\"data\":{\"row\":[{\"AssetId\":\"TCNS2006888\",\"ServerIdcId\":\"1\",\"InputTime\":\"2008-12-12\",\"AssetName\":\"月\"},{\"AssetId\":\"TCNS2006889\",\"ServerIdcId\":\"2\",\"InputTime\":\"2008-1-1\",\"AssetName\":\"亮\"}]}}}";
protected void Page_Load(object sender, EventArgs e)
{
DictJson();
c# 将JSON解析,字典Demo
最新推荐文章于 2022-12-09 11:14:59 发布
本文演示了如何在C#中使用Newtonsoft.Json库将JSON字符串解析为字典,然后遍历和访问数据。代码示例包括如何处理嵌套的JSON对象和数组,以及从JSON数据中提取特定字段。

最低0.47元/天 解锁文章
2039





