GetValue()

17/06/2004 - 21:56 por cotto | Informe spam
Mi problema es el siguiente: quiero recuperar un valor de
tipo "multi_sz" del registro...


Microsoft.Win32.RegistryKey Registro, subClaves;
string Datos;
//
Registro = Microsoft.Win32.Registry.LocalMachine;
subClaves = Registro.OpenSubKey(cadena);
Datos = subClaves.GetValue(nombre).ToString();

El problema lo tengo cuando subClaves.GetValue
(nombre).ToString() entregando el valor "{System.Array}",
en ves de el numero IP por ejemplo...

Preguntas similare

Leer las respuestas

#1 Pedro Luna Montalvo
17/06/2004 - 22:30 | Informe spam
Pues tu mismo tienes la respuesta, lo que estas recuperando es un arreglo y
no un string.

string[] Datos; // esto es un arreglo!!!

Registro = Microsoft.Win32.Registry.LocalMachine;
subClaves = Registro.OpenSubKey(cadena);
Datos = (string[]) subClaves.GetValue(nombre); // lo convierto a un arreglo
de string


Saludos
Pedro Luna
Gye, Ecu


"cotto" escribió en el mensaje
news:1df3e01c454a5$31d95440$
Mi problema es el siguiente: quiero recuperar un valor de
tipo "multi_sz" del registro...


Microsoft.Win32.RegistryKey Registro, subClaves;
string Datos;
//
Registro = Microsoft.Win32.Registry.LocalMachine;
subClaves = Registro.OpenSubKey(cadena);
Datos = subClaves.GetValue(nombre).ToString();

El problema lo tengo cuando subClaves.GetValue
(nombre).ToString() entregando el valor "{System.Array}",
en ves de el numero IP por ejemplo...
Respuesta Responder a este mensaje
#2 cotto
17/06/2004 - 23:14 | Informe spam
Muchas gracias, enserio que te lo agradesco montones... :)

Pues tu mismo tienes la respuesta, lo que estas


recuperando es un arreglo y
no un string.

string[] Datos; // esto es un arreglo!!!

Registro = Microsoft.Win32.Registry.LocalMachine;
subClaves = Registro.OpenSubKey(cadena);
Datos = (string[]) subClaves.GetValue(nombre); // lo


convierto a un arreglo
de string


Saludos
Pedro Luna
Gye, Ecu


"cotto" escribió en el mensaje
news:1df3e01c454a5$31d95440$
Mi problema es el siguiente: quiero recuperar un valor




de
tipo "multi_sz" del registro...


Microsoft.Win32.RegistryKey Registro, subClaves;
string Datos;
//
Registro = Microsoft.Win32.Registry.LocalMachine;
subClaves = Registro.OpenSubKey(cadena);
Datos = subClaves.GetValue(nombre).ToString();

El problema lo tengo cuando subClaves.GetValue
(nombre).ToString() entregando el




valor "{System.Array}",
en ves de el numero IP por ejemplo...




.

email Siga el debate Respuesta Responder a este mensaje
Ads by Google
Help Hacer una preguntaRespuesta Tengo una respuesta
Search Busqueda sugerida