Microsoft.Win32.RegistryKey.GetValue C# (CSharp) Method

GetValue() public method

public GetValue ( string name ) : object
name string
return object
        public object GetValue(string name) { throw null; }
        public object GetValue(string name, object defaultValue) { throw null; }

Same methods

RegistryKey::GetValue ( string name, object defaultValue ) : object
RegistryKey::GetValue ( string name, object defaultValue, Microsoft options ) : object

Usage Example

        /// <summary>
        /// Get framework version for specified SubKey
        /// </summary>
        /// <param name="parentKey"></param>
        /// <param name="subVersionName"></param>
        /// <param name="versions"></param>
        private static void GetDotNetVersion(RegistryKey parentKey, string subVersionName, IList<NetFrameworkVersionInfo> versions)
        {
            if (parentKey != null)
            {
                string installed = Convert.ToString(parentKey.GetValue("Install"));

                if (installed == "1")
                {
                    NetFrameworkVersionInfo versionInfo = new NetFrameworkVersionInfo();

                    versionInfo.VersionString = Convert.ToString(parentKey.GetValue("Version"));

                    var test = versionInfo.BaseVersion;

                    versionInfo.InstallPath = Convert.ToString(parentKey.GetValue("InstallPath"));
                    versionInfo.ServicePackLevel = Convert.ToInt32(parentKey.GetValue("SP"));

                    if (parentKey.Name.Contains("Client"))
                        versionInfo.FrameworkProfile = "Client Profile";
                    else if (parentKey.Name.Contains("Full"))
                        versionInfo.FrameworkProfile = "Full Profile";

                    if (!versions.Contains(versionInfo))
                        versions.Add(versionInfo);
                }
            }
        }
All Usage Examples Of Microsoft.Win32.RegistryKey::GetValue