NServiceBus.LicenseLocationConventions.GetHKCULicense C# (CSharp) Method

GetHKCULicense() static private method

static private GetHKCULicense ( string softwareKey = "NServiceBus", string subKey = null ) : string
softwareKey string
subKey string
return string
        static string GetHKCULicense(string softwareKey = "NServiceBus", string subKey = null)
        {
            var keyPath = @"SOFTWARE\" + softwareKey;

            if (subKey != null)
            {
                keyPath += @"\" + subKey;
            }

            using (var registryKey = Registry.CurrentUser.OpenSubKey(keyPath))
            {
                return (string) registryKey?.GetValue("License", null);
            }
        }