Exemplo n.º 1
0
        public KXTUserAppliesFile(string path)
        {
            Json = new KXTJson(path);

            Invaild   = false;
            VisitTime = DateTime.Now;
        }
Exemplo n.º 2
0
 public bool CreateUser(string user_id)
 {
     try
     {
         return(KXTJson.CreateFile
                (
                    RootPath + "\\" + user_id + ".json",
                    new KeyValuePair <string, KXTRootJsonType>[]
         {
             new KeyValuePair <string, KXTRootJsonType>
             (
                 "friends",
                 KXTRootJsonType.Array
             ),
             new KeyValuePair <string, KXTRootJsonType>
             (
                 "groups",
                 KXTRootJsonType.Array
             )
         }
                ));
     }
     catch
     {
         Notify(LogLevel.Warning, "用户信息数据操作异常:创建文件异常");
         return(false);
     }
 }
Exemplo n.º 3
0
        public KXTGroupInfoFile(string path)
        {
            Json = new KXTJson(path);

            Invaild   = false;
            VisitTime = DateTime.Now;
        }
Exemplo n.º 4
0
 public void AddUser(string user_id)
 {
     KXTJson.CreateFile
     (
         RootPath + "\\" + user_id + ".json",
         new KeyValuePair <string, KXTRootJsonType>[]
     {
         new KeyValuePair <string, KXTRootJsonType>("files", KXTRootJsonType.Object),
         new KeyValuePair <string, KXTRootJsonType>("dirs", KXTRootJsonType.Object)
     }
     );
 }
Exemplo n.º 5
0
        public List <string> ReadMembers(string group_id)
        {
            List <string> list = new List <string>();

            try
            {
                KXTJson Json = new KXTJson(RootPath + "\\" + group_id + ".json");

                JArray array = Json["member"] as JArray;
                foreach (var item in array)
                {
                    list.Add(item.ToString());
                }
            }
            catch
            {
                Notify(LogLevel.Warning, "群组信息数据操作异常:文件异常");
            }

            return(list);
        }
Exemplo n.º 6
0
 public bool CreateGroup(string group_id)
 {
     try
     {
         return(KXTJson.CreateFile
                (
                    RootPath + "\\" + group_id + ".json",
                    new KeyValuePair <string, KXTRootJsonType>[]
         {
             new KeyValuePair <string, KXTRootJsonType>
             (
                 "member",
                 KXTRootJsonType.Array
             )
         }
                ));
     }
     catch
     {
         Notify(LogLevel.Warning, "群组信息数据操作异常:创建文件异常");
         return(false);
     }
 }