hello!
I have written a code that writes and reads from the registry.
to write:
to read:Code:// Create a new key under HKEY_LOCAL_MACHINE\Software as MCBInc RegistryKey key = Registry.LocalMachine.OpenSubKey("Software", true); // Add one more sub key RegistryKey newkey = key.CreateSubKey("reg"); // Set value of sub key newkey.SetValue("reg", toWrite);
the problem is, that I can't read what I wrote! I am able to write to registry.Code:// Create a new key under HKEY_LOCAL_MACHINE\Software as MCBInc RegistryKey key = Registry.LocalMachine.OpenSubKey("Software", true); // Get sub key RegistryKey newkey = key.OpenSubKey("reg"); // Get value of sub key return ((string)key.GetValue("reg"));
what is wrong?
thanks!
![]()




Reply With Quote