Hola a todos, tuve un problema al intentar obtener todas las llaves del
registro de local machine:
Para ir probando el algoritmo hice un formulario con 2 listbox:
RegistryKey reg = Registry.LocalMachine;
string[] llaves = reg.GetSubKeyNames();
for (int i = 0; i < llaves.Length; i++)
{
listBox1.Items.Add(llavesIdea.ToString());
}
Hasta ahi todo bien, lo que me arroja error es cuando intento abrir las
subkeys
foreach (string subKeys in reg.OpenSubKey(holaIdea))
Pero no me deja: Error 1 foreach statement cannot operate on variables
of type 'Microsoft.Win32.RegistryKey' because 'Microsoft.Win32.RegistryKey'
does not contain a public definition for 'GetEnumerator' C:\Documents and
Settings\Pietro\Mis documentos\Visual Studio
2005\Projects\WindowsApplication2\WindowsApplication2\Form1.cs 37 17
WindowsApplication2
Que se les ocurre??
Leer las respuestas