コード例 #1
0
 /// <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);
     }
 }
コード例 #2
0
 /// ----------------------------------------------------------------------------------------
 /// <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)));
 }