C# JavaScriptSerializer JSON与实体的相互转换基类

 

 private static JavaScriptSerializer _JsSerializer = null;
        /// <summary>
        /// 获取JS序列化对象
        /// </summary>
        public static JavaScriptSerializer JSSerializer
        {
            get
            {
                if (_JsSerializer == null)
                {
                    _JsSerializer = new JavaScriptSerializer();
                    //设置Json字符串的最大长度(单次最大支持1.9G) 
                    //单次附件上传大小上限为1.9G    来源:lim(Int32.MaxValue / 1024 / 1024 / 1024)
                    //modify by  chenfei on 20170406 for int.maxval
                    //_JsSerializer.MaxJsonLength = Int32.MaxValue;
                }
                return _JsSerializer;
            }
        }

 

posted @ 2017-09-22 17:04 araki 阅读(...) 评论(...) 编辑 收藏