For certain registry path/key, I'm not getting data

0

I am using below code and for SOFTWARE\\Intel\\Bluetooth\\Metrics and Version I'm NOT getting data. What's the reason?

enter image description here

 ConnectionOptions oConn = new ConnectionOptions();
            ManagementScope scope = new ManagementScope("\\\\.\\root\\default", oConn);

            scope.Connect();
            ManagementClass registry = new ManagementClass(scope, new ManagementPath("StdRegProv"), null);
            ManagementBaseObject inParams = registry.GetMethodParameters("GetStringValue");
            inParams["sSubKeyName"] = "SOFTWARE\\Intel\\Bluetooth\\Metrics";
            inParams["hDefKey"] = 0x80000002;
            inParams["sValueName"] = "Version";


            ManagementBaseObject outParams = registry.InvokeMethod("GetStringValue", inParams, null);

            if (outParams.Properties["sValue"].Value != null)
            {
                Console.WriteLine( outParams.Properties["sValue"].Value.ToString());
            }

Note - With above code for SOFTWARE\\ASIO\\Realtek ASIO and Description, I am getting data. Why certain registry path/key NOT works?

enter image description here

inParams["sSubKeyName"] = "SOFTWARE\\ASIO\\Realtek ASIO";
            inParams["hDefKey"] = 0x80000002;
            inParams["sValueName"] = "Description";
c#
registry
asked on Stack Overflow Apr 5, 2019 by user584018

0 Answers

Nobody has answered this question yet.


User contributions licensed under CC BY-SA 3.0