Hello all,
I'm currently developing a C# application which will record registry changes, save them to a file, then later be able to write the preferences saved to the file back to the registry.
So far I can get all the way through the process till I try and write the values back to the file. The code runs through with no errors, but when I look in the registry the values I've changed haven't changed and when I've tried to create new values they haven't been created so I need a hand.
Just for further information I'm creating and testing the application in Windows XP SP3.
Just to show you what I'm doing, heres 2 examples. The one below I've used just to create some new subkeys and values and at no point do any appear in regedit:
RegistryKey rk = Registry.CurrentUser.CreateSubKey("Test9999");
using (RegistryKey testName = rk.CreateSubKey("TestName"), testSettings = rk.CreateSubKey("TestSettings"))
{
// Create data for the TestSettings subkey.
testSettings.SetValue("Language", "French");
testSettings.SetValue("Level", "Intermediate");
testSettings.SetValue("ID", 123);
}
This second example shows the key that I really want to work on, what I'm testing here is whether it creates a new value test, enters the value held by the testing string and set it as the correct value kind. The real value I want to change is 01020402 in the same key which changes whether outlooks reading pane is at the right or bottom of the screen, but I thought it would be best to test first:
Registry.Users.SetValue("S-1-5-21-2055990625-1247778217-514451997-41655\\\\Software\\\\Microsoft\\\\Windows NT\\\\CurrentVersion\\\\Windows Messaging Subsystem\\\\Profiles\\\\Outlook\\\\0a0d020000000000c000000000000046\\\\test", testing, RegistryValueKind.String);
In the above example no new value is created or stored.
If anyone can see where I'm going wrong or give me any help it would be appreciated.