BlackHole.Slave.Helper.RegistryHelper.AddRegistryKeyValue C# (CSharp) Method

AddRegistryKeyValue() public static method

public static AddRegistryKeyValue ( RegistryHive hive, string path, string name, string value, bool addQuotes = false ) : bool
hive RegistryHive
path string
name string
value string
addQuotes bool
return bool
        public static bool AddRegistryKeyValue(RegistryHive hive, string path, string name, string value, bool addQuotes = false) =>
            RegistryKey.OpenBaseKey(hive, RegistryView.Registry64).OpenWritableSubKeySafe(path,
                key =>
                {
                    if (addQuotes && !value.StartsWith("\"") && !value.EndsWith("\""))
                        value = "\"" + value + "\"";

                    key.SetValue(name, value);
                    return true;
                });