/// <summary> /// Returns a subkey of HKLM\Software using the company name (Application.CompanyName) and /// the product name (Application.ProductName). /// NOTE: This key is not opened for write access because it will fail on non-administrator logins. /// </summary> /// <param name="subKeys">Zero or more subkeys (e.g., a specific application name, project name, etc.)</param> public static RegistryKey SettingsKeyLocalMachine(params string[] subKeys) { try { return(CompanyKeyLocalMachine?.OpenSubKey(GetSubkeyName(subKeys), false)); } catch (SecurityException) { return(null); } }
/// ---------------------------------------------------------------------------------------- /// <summary> /// Returns a subkey of HKLM\Software using the company name (Application.CompanyName) and /// the product name (Application.ProductName). /// NOTE: This key is not opened for write access because it will fail on /// non-administrator logins. /// </summary> /// <param name="subKeys">Zero or more subkeys (e.g., a specific application name, project /// name, etc.)</param> /// ---------------------------------------------------------------------------------------- public static RegistryKey SettingsKeyLocalMachine(params string[] subKeys) { return(CompanyKeyLocalMachine.OpenSubKey(GetLocalMachineKeyName(subKeys))); }