コード例 #1
0
ファイル: AccountManager.cs プロジェクト: unslur/ShitYun
 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);
     }
 }
コード例 #2
0
ファイル: AccountManager.cs プロジェクト: unslur/ShitYun
        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);
        }
コード例 #3
0
ファイル: AccountManager.cs プロジェクト: unslur/ShitYun
        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);
        }