BigAbility <km*****@msn.com> wrote:
regKey = regKey.OpenSubKey("....");
regKey.SetValue("...", "value");
this code doesn't work
registry modification not allow in .Net??
how should i do?
Firstly, when asking a question it's helpful to give as much
information as possible: a short but complete program is always useful
(see
http://www.pobox.com/~skeet/csharp/complete.html for what I meanby
that) but even if you just provide a couple of lines of code, "this
code doesn't work" is far from helpful. Obviously you have more
information about in what way it doesn't work - why not tell us?
As it happens, in this case you only need to read the docs to find out
why it's not working. You're calling RegistryKey.OpenSubKey(string),
the docs for which say:
<quote>
Retrieves a subkey as read-only.
</quote>
If you want a writable key, use RegistryKey.OpenSubkey (name, true)
--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet
If replying to the group, please do not mail me too