Beispiel #1
0
 private static void SaveData(string filePath, AccountCollection sourceObj)
 {
     if (!string.IsNullOrEmpty(filePath) && sourceObj != null)
     {
         var json = NimUtility.Json.JsonParser.SerializeWithIndented(sourceObj);
         File.WriteAllText(filePath, json);
     }
 }
Beispiel #2
0
        public static void SaveLoginAccounts(AccountCollection collection)
        {
            var path = System.IO.Path.Combine(System.Environment.CurrentDirectory, SettingFilePath);

            foreach (var item in collection.List)
            {
                item.Password = DESEncrypt(item.Password, DESKey, DESIV);
            }
            SaveData(path, collection);
        }
Beispiel #3
0
        private static AccountCollection LoadData(string filePath)
        {
            AccountCollection result = null;

            if (File.Exists(filePath))
            {
                var content = File.ReadAllText(filePath);
                result = NimUtility.Json.JsonParser.Deserialize <AccountCollection>(content);
            }

            return(result);
        }