先写一下原因吧!我是写的SSH项目,在项目中我遇到的问题是把分页对象(也就是pageBean对象)转化为json数据,下面为代码: public class PageBean <T>{//当前页private int pageNum;//页面显示数量private int pageSize; //查询总数(查询数据库所得)private int totalRecord;//当前页开始索引private int startIndex; //总页面数private int totalPage; /
public static string ObjectToJson<T>(IList<T> IL, params string[] args) { var Json = new StringBuilder(); Json.Append("["); ) { ; i < IL.Count; i++) { Type type = IL[i].GetType(); Json.Append("{"); ; x < args.Length;
using System; using System.Collections.Generic; using System.Text; using System.Reflection; using System.Data; using System.Collections; namespace AIMSCommon { /// <summary> /// 转换Json格式帮助类 /// </summary> public class JsonHelper { /// <summ
1.需要用到的包 2.实例 实体类 people package com.shore.entity; /** * @author DSHORE/2019-4-19 * */ public class People { private int pid; private String pname; private int age; private String job; private double sal; public People() { } public People(int pid, St