MCPcopy Create free account
hub / github.com/bytecode77/r77-rootkit / DeleteEntry

Method DeleteEntry

TestConsole/Helper/ConfigSystem.cs:188–209  ·  view source on GitHub ↗

Deletes an entry from the configuration system. The name of the config directory. The name of the config entry.

(string directoryName, string entryName)

Source from the content-addressed store, hash-verified

186 /// <param name="directoryName">The name of the config directory.</param>
187 /// <param name="entryName">The name of the config entry.</param>
188 public static void DeleteEntry(string directoryName, string entryName)
189 {
190 using RegistryKey? configKey = GetConfigSystemKey();
191 using RegistryKey? key = configKey?.OpenSubKey(directoryName, true);
192
193 if (key != null && key.GetValueNames().Contains(entryName))
194 {
195 key.DeleteValue(entryName);
196
197 Log.Information(
198 new LogTextItem("Deleted config system entry"),
199 new LogFileItem($"{directoryName}/{entryName}")
200 );
201 }
202 else
203 {
204 Log.Error(
205 new LogTextItem("Failed to delete config system entry"),
206 new LogFileItem($"{directoryName}/{entryName}")
207 );
208 }
209 }
210}

Calls 2

InformationMethod · 0.80
ErrorMethod · 0.80

Tested by

no test coverage detected