Esempio n. 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;
 }
Esempio n. 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);
        }
Esempio n. 3
0
 public void SaveDB()
 {
     userdb.Save();
 }