0

if I run below code I would get:

 PG_ID_N_1_NA_ID_1,
 PG_ID_N_2_NA_ID_1,
 PG_ID_N_3_NA_ID_1,
 PG_ID_N_4_NA_ID_1

enter image description here

However what I would like to do is to get the value of FriendlyName REG_SZ under each of those keys.

RegistryKey r = Registry.LocalMachine;
r = r.OpenSubKey(@"SYSTEM\CurrentControlSet\Enum\{C641C770-FAAC-44ED-9C73-48D1B5E59200}\NDIS&VEN_1924&DEV_0803&SUBSYS_62271924", false);
foreach (string s in r.GetSubKeyNames())
{
    Console.WriteLine(s);
}
r.Close();
spajce
  • 7,044
  • 5
  • 29
  • 44
John Ryann
  • 2,283
  • 11
  • 43
  • 60
  • 1
    are you trying to return the names of the applications that belong to those SubKeyNames...? will link help you.. http://stackoverflow.com/questions/13324920/regedit-shows-keys-that-are-not-listed-using-getsubkeynames or http://stackoverflow.com/questions/6089148/get-value-of-registry-key-c-sharp – MethodMan Jan 09 '13 at 21:42
  • screenshot attached. I would like to get the value of "FriendlyName" which is available on each of those PGs. – John Ryann Jan 09 '13 at 21:52
  • instead of r.GetSubKeyNames() will r.GetValueNames() work – MethodMan Jan 09 '13 at 21:58

1 Answers1

0

What about:

RegistryKey r = Registry.LocalMachine;
r = r.OpenSubKey(@"SYSTEM\CurrentControlSet\Enum\{C641C770-FAAC-44ED-9C73-48D1B5E59200}\NDIS&VEN_1924&DEV_0803&SUBSYS_62271924", false);  
foreach (string s in r.GetSubKeyNames())
{
    using (RegistryKey subKey = r.OpenSubKey(s))
    {
        Console.WriteLine(subKey.GetValue("FriendlyName"));
    }
}
r.Close();

I don't have a compiler on this computer so the code above might be crap.

RobH
  • 3,604
  • 1
  • 23
  • 46