json字符串解析

时间:2019-12-04 08:48:30
【文件属性】:

文件名称:json字符串解析

文件大小:76KB

文件格式:DLL

更新时间:2019-12-04 08:48:30

json

把下载的文件放在Bin目录下,使用时代码如下: using System.Web.Script.Serialization; PageResult pr = new PageResult(); pr.PageCount = (int)Math.Ceiling(tolNum / 10.0);//0.1→1,0.95→1,1.01→2,1.0→1//总页数。 tolNum; pr.Comm = new commentInfo[dt.Rows.Count]; pr.RecordCount = tolNum; for (int i = 0; i < dt.Rows.Count; i++) { pr.Comm[i] = new commentInfo() { ProjectName = dt.Rows[i]["ProjectName"].ToString(), ID = dt.Rows[i]["ID"].ToString(), Explorations = dt.Rows[i]["Explorations"].ToString(), Price = dt.Rows[i]["States"].ToString() }; } context.Response.Write(new JavaScriptSerializer().Serialize(pr)); } class PageResult { public commentInfo[] Comm { get; set; } public int PageCount { get; set; } public int RecordCount { get; set; } }


网友评论