public static bool SetConfig(string KeyName, string KeyValue, RegistryValueKind RegKind = RegistryValueKind.String) { try { RegistryKey RegKey; RegKey = Registry.CurrentUser.CreateSubKey("Software\\NUTty UPS Client"); RegKey.SetValue(KeyName, KeyValue); RegKey.Close(); } catch (Exception e) { Backend.Background.WriteNUTLog("[CONFIG] Could not set registry key: " + KeyName + " wtih value " + KeyValue + "\nException:" + e); return(false); } Backend.Background.WriteNUTLog("[CONFIG] Set registry key " + KeyName + " with value " + KeyValue); return(true); }