ComponentFactory.Krypton.Ribbon.EncryptedLicenseProvider.ReadKeyFromRegistry C# (CSharp) Method

ReadKeyFromRegistry() protected method

Grab the key from the registry.
protected ReadKeyFromRegistry ( ) : string
return string
        protected virtual string ReadKeyFromRegistry()
        {
            // Open the version specific key we need
            string versionPath = _licensePath + _licenseVersion.ToString();
            RegistryKey versionKey = Registry.CurrentUser.OpenSubKey(versionPath, false);
            if (versionKey != null)
            {
                // Seach for each of the product codes we allow
                foreach (string code in _licenseProducts)
                {
                    object ret = versionKey.GetValue(code, null);
                    if ((ret != null) && (ret is string))
                        return (string)ret;
                }
            }

            return null;
        }