I am using vb.net and I want to count values in windows registry key under HKEY_CURRENT_USER\SOFTWARE\MYAPP
. Using the code below:
Dim tempKey As RegistryKey = Registry.CurrentUser.OpenSubKey("Software\MyApp")
Dim count As Integer = tempKey.ValueCount.ToString
but I'm getting an error on the second line saying:
Object reference not set to an instance of an object.
Please I need your help.