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); } }
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); }