create registry key

B

Ben

I am having a problem creating a registry key. I am using the following
code:

My.Computer.Registry.LocalMachine.CreateSubKey("Software\programalpha")
My.Computer.Registry.LocalMachine.SetValue("loglevel", "7")
My.Computer.Registry.LocalMachine.GetValue("loglevel")

When I run the above code the programalpha key is created. The loglevel
value (which can hold the value of numbers between 1 and 10) does not get
created. What am I doing wrong?

Thanks,
Ben
 
I

IdleBrain

Hai,
Maybe it is getting created in a default location.

See if this helps:
My.Computer.Registry.LocalMachine.CreateSubKey("Software\programalpha")
My.Computer.Registry.LocalMachine.SetValue("Software\programalpha\loglevel",
"7")
My.Computer.Registry.LocalMachine.GetValue("Software\programalpha\loglevel")


Just a thought..
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top