public static GoogleAccount[] AllAccounts() { try { RegistryKey key = Registry.CurrentUser.OpenSubKey(RegBase); if (key == null) { return(null); } string[] accounts = key.GetSubKeyNames(); int length = accounts.Length; GoogleAccount[] gAccounts = new GoogleAccount[length]; for (int i = 0; i < length; i++) { SecureStorage ss = new SecureStorage("Google", accounts[i]); ss.Load(); GoogleAccount gAccount = new GoogleAccount(ss.Username, ss.Password, ss.RegSaveBase); gAccounts[i] = gAccount; } return(gAccounts); } catch { return(null); } }
public static GoogleAccount Account(string email) { try { SecureStorage ss = new SecureStorage("Google", email); ss.Load(); GoogleAccount gAccount = new GoogleAccount(ss.Username, ss.Password, ss.RegSaveBase); return(gAccount); } catch { return(null); } }