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);
     }
 }
Beispiel #2
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)
     }
     );
 }
 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);
     }
 }