コード例 #1
0
        public void DelGroup(string user_id, string group)
        {
            try
            {
                if (!Cache.TryGetValue(user_id, out KXTUserInfoFile file))
                {
                    file = new KXTUserInfoFile
                           (
                        RootPath + "\\" + user_id + ".json"
                           );
                    Cache.TryAdd(user_id, file);
                }

                file.DelGroup(group);
            }
            catch
            {
                Notify(LogLevel.Warning, "用户信息数据操作异常:文件异常");
            }
        }
コード例 #2
0
        public string[] ReadGroups(string user_id)
        {
            try
            {
                if (!Cache.TryGetValue(user_id, out KXTUserInfoFile file))
                {
                    file = new KXTUserInfoFile
                           (
                        RootPath + "\\" + user_id + ".json"
                           );
                    Cache.TryAdd(user_id, file);
                }

                file.ReadGroups(out string[] friends);

                return(friends);
            }
            catch
            {
                Notify(LogLevel.Warning, "用户信息数据操作异常:文件异常");
                return(new string[0]);
            }
        }