public static void Save() { // Save account keys EncryptedFileManager.WriteObject(_accountInfo, accountInfoFile); // Set account file as hidden File.SetAttributes(accountInfoFile, File.GetAttributes(accountInfoFile) | FileAttributes.Hidden); // Save other properties Properties.Settings.Default.Save(); }
static UserSettings() { try { // load the account info from a file _accountInfo = EncryptedFileManager.ReadObject <AccountInfo>(accountInfoFile); } catch (Exception) { // do nothing } }