I want to delete registry value by clicking on button.
I have code, but when i click on the button, it says "No value exists with that name".
But there's a value.
Here's the code:
string cryptographyKey = @"SOFTWARE\Microsoft\Cryptography";
RegistryKey ckey = Registry.LocalMachine.OpenSubKey(cryptographyKey, true);
ckey.DeleteValue("MachineGuid");
When i debugging it, the error is on ckey.DeleteValue("MachineGuid");
There's a value called MachineGuid
exists in the location HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Cryptography
But why do i get that error?