Пример #1
0
 public static UserDB Load()
 {
     if (!File.Exists(Filename))
     {
         UserDB b = new UserDB();
         b.Save();
     }
     UserDB db;
     JsonSerializer ser = new JsonSerializer();
     using (StreamReader r = new StreamReader(Filename))
     using (JsonTextReader reader = new JsonTextReader(r))
     {
         db = ser.Deserialize<UserDB>(reader);
     }
     return db;
 }
Пример #2
0
        public static UserDB Load()
        {
            if (!File.Exists(Filename))
            {
                UserDB b = new UserDB();
                b.Save();
            }
            UserDB         db;
            JsonSerializer ser = new JsonSerializer();

            using (StreamReader r = new StreamReader(Filename))
                using (JsonTextReader reader = new JsonTextReader(r))
                {
                    db = ser.Deserialize <UserDB>(reader);
                }
            return(db);
        }
Пример #3
0
 public void SaveDB()
 {
     userdb.Save();
 }