Ejemplo n.º 1
0
        private bool writeColumnValueByKey(string keyName, string columnStr)
        {
            try
            {
                string   regPath       = RegistryKeyMap.getRegKeyPath(keyName);
                string[] regPath_Split = regPath.Split("\\".ToCharArray());

                RegistryKey itKey = this.getWritableKeyPath(regPath_Split);

                if (itKey == null)
                {
                    return(false);
                }

                itKey.SetValue(keyName, columnStr, RegistryValueKind.String);

                itKey.Close();

                return(true);
            }
            catch
            {
                return(false);
            }
        }
Ejemplo n.º 2
0
        private string getValueByKey(string keyName)
        {
            string      regPath   = RegistryKeyMap.getRegKeyPath(keyName);
            RegistryKey columnKey = this.getReadableKeyPath(regPath.Split('\\'));

            if (columnKey != null && columnKey.GetValue(keyName) != null)
            {
                return(columnKey.GetValue(keyName).ToString());
            }
            return(string.Empty);
        }