Exemplo n.º 1
0
        protected static void RegKeySetValue(WinRegSystem wRegSystem, WinRegKey wRegKey, object value, RegistryValueKind valueKind = RegistryValueKind.DWord)
        {
            try
            {
                RegistryKey rk = RegGetAppKey(wRegSystem, WinRegMode.Write);

                rk.SetValue(wRegKey.ToString(), value, valueKind);
                rk.Close();
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Exemplo n.º 2
0
        protected static string RegKeyGetValue(WinRegSystem wRegSystem, WinRegKey wRegKey)
        {
            try
            {
                RegistryKey rk = RegGetAppKey(wRegSystem);

                if (rk.GetValue(wRegKey.ToString()) != null)
                {
                    return(rk.GetValue(wRegKey.ToString(), string.Empty).ToString());
                }
                else
                {
                    return(string.Empty);
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }