Hello,
I'm in the process of creating a C# application which will monitor changes made to the registry and write them back to the registry next time the user logs on.
So far I've got it monitoring changes, reporting them, writing the hive, key and value to a text file. I'm now at the point where I need to take them values out of the file and place them back into the registry. Now I've looked at various tutorials but none have been able to answer the question/problem I have, so for example the registry key I wish to change is:
HKEY_USERS\S-1-5-21-2055990625-1247778217-514451997-41655\Software\Microsoft\Windows NT\CurrentVersion\Windows Messaging Subsystem\Profiles\Outlook\0a0d020000000000c000000000000046 the value of 01020402 and the contents contained within that
What I want to be able to do is write back to that and change the value as appropriate. I currently have 3 strings, one contains the key location, one the value and the final is the contents of the value, although I could easily change the string manipulation to get and not get whatever I need or don't need. So if someone could provide me with a way to write to that it would be appreciated.
P.S so you know, that paticular value is a binary value that I converted to string for storage. If you require any further information please let me know.
Any help would be appreciated....thanks
EDIT Code I'm currently using:
public class reg
{
public void write(string key, string valueName, string value)
{
Byte[] byteValue = System.Text.Encoding.UTF8.GetBytes(value);
Registry.SetValue(key, valueName, value, RegistryValueKind.Binary);
}
}