registro de windows

03/02/2005 - 10:42 por Anonimo | Informe spam
como puedo acceder al registro de windows ??

leer, grabar, modificiar

muchas gracias a todos
 

Leer las respuestas

#1 mente
03/02/2005 - 10:38 | Informe spam
A ver si te sirve este código hay una función para la lectura y otra
para la edición

using Microsoft.Win32;

public static string leerClaveRegistro(string strCarpetas,string strValor)
{

RegistryKey regVersion;
string keyValue="Software\\mente\\HermesTareas\\"+strCarpetas;
regVersion = Registry.CurrentUser.OpenSubKey(keyValue, false);
string strTorna = "";
if (regVersion!=null)
{
strTorna = regVersion.GetValue(strValor, 0).ToString();
regVersion.Close();
}
return strTorna.Replace('"','·').Replace("·","");


}
public static void EditarRegistro(string strSubCarpetas,string
strClave, object Valor)
{
RegistryKey regVersion;
regVersion =
Registry.CurrentUser.OpenSubKey("SOFTWARE\\mente\\HermesTareas\\"+strSubCarpetas,
true);
if(regVersion==null)
{
//no existe crear
regVersion =
Registry.CurrentUser.CreateSubKey("SOFTWARE\\mente\\HermesTareas\\"+strSubCarpetas);
}

regVersion.SetValue(strClave,Valor);

}
como puedo acceder al registro de windows ??

leer, grabar, modificiar

muchas gracias a todos


Preguntas similares