Hi,
I am trying to understand how Registry works under c#.
All examples that I have found are pretty much same, but I always get null as a result, and I am sure that registry path DOES exists.
For example, I want to check if this registry key (path) exists:
SOFTWARE\Microsoft\Windows\CurrentVersion\WindowsUpdate under HKLM.
I am not looking for strings or values, just if KEY exists or not.
Thank you all for your suggestions.
What I have tried:
var key = Registry.LocalMachine.OpenSubKey(@"SOFTWARE\Microsoft\Windows\CurrentVersion\WindowsUpdate");
if (key == null)
{
// Not exists
}
else
{
// Exists
}