I want to update "SCRNSAVE.EXE" value using my c# sample code..
But its doesnt allowing me to do so..!!
Can any one help me on this, below is the function that i am using to update value.
private void setAsDefaultScreenSaver(string valuePath)
{
RegistryKey key = Registry.CurrentUser.OpenSubKey("Control Panel\\Desktop");
if (key == null)
return;
else
{
key.SetValue("SCRNSAVE.EXE", valuePath);
key.SetValue("ScreenSaveActive", "1");
}
}
You are opening the subkey as read-only. You need to pass in true as the second param to write to it.