I want to read the registry key \HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\ProductName.
When I check the key in the registry editor, I'm getting the value "Window 10 Pro". However, when I'm reading the same key in my c# application, the result is "Window 10 Enterprise" Any ideas what the reason can be for this strange behaviour?
The OS is a Windows 10 64bit version, the application is targeted to .NET Framework 4.6.1, the platform for building in visual studio is 'Any CPU'.
The code snippet from my application:
registryKey = Registry.LocalMachine.OpenSubKey(
@"SOFTWARE\Microsoft\Windows NT\CurrentVersion", false);
if (registryKey != null)
{
nameString = registryKey.GetValue("ProductName", "-Unknown-").ToString();