zoukankan      html  css  js  c++  java
  • Newtonsoft.Json 把对象转换成json字符串

                var resultJson = new
                {
                    records = rowCount,
                    page = pageindex,
                    //总页数=(总页数+页大小-1)/页大小
                    total = (rowCount + pagesize - 1) / pagesize,//总页数
                    rows = data.ToList<Web.Entity.Db.Table1Bean>(),
                };
    
                //JsonResult jr = Json(resultJson, "application/json", System.Text.Encoding.UTF8, JsonRequestBehavior.AllowGet);
    
                //Newtonsoft.Json 把对象转换成json字符串
                string json = Newtonsoft.Json.JsonConvert.SerializeObject(resultJson);
    
  • 相关阅读:
    swift
    swift
    swift
    swift
    swift
    swift
    swift
    swift
    Swift
    Nginx 访问控制
  • 原文地址:https://www.cnblogs.com/webenh/p/5797825.html
Copyright © 2011-2022 走看看