Reading value from registry

.net, c#, registry

Solution

64bit + 32bit

   using Microsoft.Win32;
    public static string GetRegistry()
    {
        string registryValue = string.Empty;
        RegistryKey localKey = null;
        if (Environment.Is64BitOperatingSystem)
        {
            localKey = RegistryKey.OpenBaseKey(Microsoft.Win32.RegistryHive.LocalMachine, RegistryView.Registry64);
        }
        else
        {
            localKey = RegistryKey.OpenBaseKey(Microsoft.Win32.RegistryHive.LocalMachine, RegistryView.Registry32);
        }

        try
        {
            localKey = localKey.OpenSubKey(@"Software\\MyKey");
            registryValue = localKey.GetValue("TestKey").ToString();
        }
        catch (NullReferenceException nre)
        {

        }
        return registryValue;
    }

Problem

google is not helping me today, so i need your help. Is there a possible way to read a value from a registry ? example this location --> HKEY_LOCAL_MACHINE > SOFTWARE > MyKey the column is Test key

Original source