I don't have much
(read: as good as no) experience with VB.NET either, but here are my thoughts (taken from the MSDN library):
quote:
Originally posted by ryxdp
code:
My.Computer.Registry.CurrentUser.DeleteValue("HKEY_CURRENT_USER\Control Panel\Desktop\testingval\")
for starters, is
My.Computer.Registry.CurrentUser defined as a proper
RegistryKey object?
Second, if "testingval" is a value, you should not add the last backslash (you shouldn't even add it if it is a subkey, I think).
Second, you need to open that key first before you can delelete the value "testingval"...
See
DeleteValue
eg:
' Creates a subkey under HKCU named "Test9999"
Dim test9999 As RegistryKey = Registry.CurrentUser.CreateSubKey("Test9999")
' Thus not:
' Registry.CurrentUser.CreateSubKey("HKEY_CURRENT_USER\Test9999\") I think
Dim testSettings As RegistryKey = test9999.CreateSubKey("TestSettings")
testSettings.SetValue("ID", 123)
testSettings.Close()
' Deletes the newly created "id"
value under the "HKCU\Test9999\TestSettings\"
key. Assuming test9999 is a proper defined RegistryKey object.
testSettings = test9999.
OpenSubKey("TestSettings", True)
testSettings.
DeleteValue("id")
testSettings.
Close()
Full example code is given on the
MSDN library::RegistryKey Class