C
cr
Hello.
I have a C# (Windows forms) project that uses OpenSubKey to write some
values to a registry key. Here's the code:
// Create the Installation registry key and values
Microsoft.Win32.Registry.LocalMachine.CreateSubKey("SOFTWARE\\Company\\Produ
ct\\1.0\\Installation");
Microsoft.Win32.RegistryKey install =
Microsoft.Win32.Registry.LocalMachine.OpenSubKey("SOFTWARE\\Company\\Product
\\1.0\\Installation", true);
install.SetValue("SERVERNAME", "ServerName");
install.SetValue("VERSION", "Version");
install.Flush();
install.Close();
For some reason on a Windows XP Pro box, the code hangs after writing the
registry values. No exceptions are thrown. On Win2k and W2k3 Server boxes,
it works just fine.
Does anyone have any idea as to why this code would hang (especially on a
WinXP Pro computer)?
Is there a better way of doing this?
Thanks.
I have a C# (Windows forms) project that uses OpenSubKey to write some
values to a registry key. Here's the code:
// Create the Installation registry key and values
Microsoft.Win32.Registry.LocalMachine.CreateSubKey("SOFTWARE\\Company\\Produ
ct\\1.0\\Installation");
Microsoft.Win32.RegistryKey install =
Microsoft.Win32.Registry.LocalMachine.OpenSubKey("SOFTWARE\\Company\\Product
\\1.0\\Installation", true);
install.SetValue("SERVERNAME", "ServerName");
install.SetValue("VERSION", "Version");
install.Flush();
install.Close();
For some reason on a Windows XP Pro box, the code hangs after writing the
registry values. No exceptions are thrown. On Win2k and W2k3 Server boxes,
it works just fine.
Does anyone have any idea as to why this code would hang (especially on a
WinXP Pro computer)?
Is there a better way of doing this?
Thanks.