By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
446,281 Members | 2,216 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 446,281 IT Pros & Developers. It's quick & easy.

Working with WIndows Registry

P: n/a
I am trying to write to the registry and the objects that are suppose to be
handling this function are not working. Here is what is happening.

I am issuing the following commands:
RegistryKey reg;
reg = Registry.CurrentUser.CreateSubKey("Software\\SofTe k
Software\\SSILicense\\Settings");

reg = Registry.CurrentUser.OpenSubKey("Software\\mykey\\ mysubkey\\Settings",
true);

reg.SetValue("DBPath", "c:\\temp");

when I execute these lines, the function does write to the registry,
however, it does not write to HKEY_Current_User. Its writing to HKEY_USER.
There are no entries at all in CurrentUser like the command suggests that
its writing to.

Can anyone help me with this as its been a real pain. I do this sort of
thing in Delphi everyday and have never had any problems. Can C# not work
with the registry? NOTE: I've also tried writing to other keys such as
HKEY_LOCAL_MACHINE but it doesn't write to the registry at all when I use
it.

Its not an authorization issue as I'm currently logged in as ADMINISTRATOR
while running these tests...

Thanks,

glenn

Jul 21 '05 #1
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.