首页 > 扩展 > JSON > 正文

litjson读取数据示例

2024-09-06 20:18:15
字体:
来源:转载
供稿:网友

1.下载并应用LitJson,DLL文件

2.建两个类;

代码如下:
   public class JsonData
    {
        public string result { get; set; }
        public List<GameData> info { get; set; }
    }


      public GameData()
        { }
        #region Model
        private int _id;
        private string _dept;
        private string _sid;
        private string _oldsid;
        private string _userid;
        private string _roleid;
        private string _rolename;
        private string _rolelevel;
        private string _gold;
        private string _money;
        private string _inittime;
        private string _lastlogin;
        private string _querytime;
        /// <summary>
        ///
        /// </summary>
        public int ID
        {
            set { _id = value; }
            get { return _id; }
        }
        /// <summary>
        /// 平台编号
        /// </summary>
        public string dept
        {
            set { _dept = value; }
            get { return _dept; }
        }
        /// <summary>
        /// 服务器编号
        /// </summary>
        public string sid
        {
            set { _sid = value; }
            get { return _sid; }
        }
        /// <summary>

发表评论 共有条评论
用户名: 密码:
验证码: 匿名发表