Judging from the comments I received yesterday, it looks like we need to review serialization in .NET.
Q. I’m trying to write to HKLM on a Vista computer using the following code:
Dim k As Microsoft.Win32.RegistryKey k = Microsoft.Win32.Registry.LocalMachine.OpenSubKey("software", True) k = k.CreateSubKey("subkey1\testprogram") k.SetValue("foo", "bar")
But, when I get to the last line, the UnauthorizedAccessException is thrown. How do I fix this?