This commit is contained in:
tovares 2018-06-26 22:55:14 +00:00
parent 372ea9884c
commit 08b7adc81f

View file

@ -12,22 +12,22 @@ namespace Atesa.Utilitarios
private string key = @"SOFTWARE\\Parametros";
public ObtieneParametros(string subkey = null)
{
try
{
this.key = string.IsNullOrWhiteSpace(subkey) ? this.key : string.Format(@"{0}\{1}", this.key, subkey);
RegistryKey key = RegistryKey.OpenBaseKey(RegistryHive.LocalMachine, Environment.Is64BitOperatingSystem ? RegistryView.Registry64 : RegistryView.Registry32);
if (key.OpenSubKey(this.key) == null)
{
key.CreateSubKey(this.key, RegistryKeyPermissionCheck.ReadWriteSubTree);
}
}
catch
{
throw new Exception("The registry key 'ParametrosProceso' does not exist and could not create it");
}
}
// public ObtieneParametros(string subkey = null)
//{
// try
// {
// this.key = string.IsNullOrWhiteSpace(subkey) ? this.key : string.Format(@"{0}\{1}", this.key, subkey);
// RegistryKey key = RegistryKey.OpenBaseKey(RegistryHive.LocalMachine, Environment.Is64BitOperatingSystem ? RegistryView.Registry64 : RegistryView.Registry32);
// if (key.OpenSubKey(this.key) == null)
// {
// key.CreateSubKey(this.key, RegistryKeyPermissionCheck.ReadWriteSubTree);
// }
// }
// catch
// {
// throw new Exception("The registry key 'ParametrosProceso' does not exist and could not create it");
// }
//}
public void AddValueKeyRegedit(string KeyStringName, string KeyStringValue, bool Encrypt)
{
try