title: c# I need ManagementBaseObject to return an array of registry
body: <p>Im using Management class that i don't really know about, just to read remote registry : </p>
  
  <pre><code>        string regKeyToGet = @"SOFTWARE\ODBC\ODBC.INI\ODBC Data Sources";
          string keyToRead = "Description";
          ConnectionOptions oConn = new ConnectionOptions();
          oConn.Username = "user1";
          oConn.Password = "user1password";
  
          ManagementScope scope = new ManagementScope(@"//" + "PC1" + @"/root/default", oConn);
          ManagementClass registry = new ManagementClass(scope, new ManagementPath("StdRegProv"), null);
  
          ManagementBaseObject inParams = registry.GetMethodParameters("GetStringValue");
          inParams["sSubKeyName"] = regKeyToGet;
          inParams["sValueName"] = keyToRead;
          ManagementBaseObject outParams = registry.InvokeMethod("GetStringValue", inParams, null);
          MessageBox.Show(outParams["sValue"].ToString());
  </code></pre>
  
  <p>This code returns me a specific value for a specified key but what i need is to return an array of name value just like :</p>
  
  <pre><code>RegistryKey regKey = RegistryKey.OpenRemoteBaseKey(RegistryHive.CurrentUser, PC1, RegistryView.Registry64).OpenSubKey("SOFTWARE\\ODBC\\ODBC.INI\\ODBC Data Sources");
  regKey.GetValueNames();
  </code></pre>