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

Registry Help Please!

P: n/a
Hello,

I've been reading this newsgroup for some time and have found all of you
very helpful and knowledgable. So, first and foremost, thank you for all your
help you've provided and don't even realize it! Secondly, here's my
question...

I haven't seen this addressed so maybe it's common knowledge, and I'm just a
moron, but here goes:

How do I add a key to the registry during runtime?

Here's the scenario:
The opens the program, it checks for a value in the registry. If the value
is not there, it prompts the user to register. After the user registers, I
need the program to store the created value in the appropriate key. That way,
the next time the program is run, the user will not be prompted for
registration again.

The key to be created is called "Auth" and it is in the following directory:
HKEY_LOCAL_MACHINE\Software\AppName

I know that SaveSetting will create a value, but it won't create it in a
specified directory.

Thank You All So Much for any help you can provide, and I'm looking forward
to hearing from you. Thanks!

Jonathan
Nov 21 '05 #1
Share this Question
Share on Google+
5 Replies


P: n/a
Use the Registry Class under the Microsoft.Win32 namespace. Here are couple
of samples:
http://www.freevbcode.com/ShowCode.asp?ID=4487
http://www.freevbcode.com/ShowCode.Asp?ID=174
http://www.codeproject.com/vb/net/registry_with_vb.asp

hope that helps..
Imran.
"MVaughn" <MV*****@discussions.microsoft.com> wrote in message
news:69**********************************@microsof t.com...
Hello,

I've been reading this newsgroup for some time and have found all of you
very helpful and knowledgable. So, first and foremost, thank you for all
your
help you've provided and don't even realize it! Secondly, here's my
question...

I haven't seen this addressed so maybe it's common knowledge, and I'm just
a
moron, but here goes:

How do I add a key to the registry during runtime?

Here's the scenario:
The opens the program, it checks for a value in the registry. If the value
is not there, it prompts the user to register. After the user registers, I
need the program to store the created value in the appropriate key. That
way,
the next time the program is run, the user will not be prompted for
registration again.

The key to be created is called "Auth" and it is in the following
directory:
HKEY_LOCAL_MACHINE\Software\AppName

I know that SaveSetting will create a value, but it won't create it in a
specified directory.

Thank You All So Much for any help you can provide, and I'm looking
forward
to hearing from you. Thanks!

Jonathan

Nov 21 '05 #2

P: n/a
Imran...you are my HERO!!

I've been looking and looking, but in ignorance...didn't know where to look.
Thank you SO MUCH! It worked like a charm. I kept getting an error and
couldn't figure out why. Turns out, when I was opening my Subkey, I didn't
realize I had to set it to writeable by setting a value to True.

Thank you again! I've been pulling my hair out with this for three days!

Jonathan

"Imran Koradia" wrote:
Use the Registry Class under the Microsoft.Win32 namespace. Here are couple
of samples:
http://www.freevbcode.com/ShowCode.asp?ID=4487
http://www.freevbcode.com/ShowCode.Asp?ID=174
http://www.codeproject.com/vb/net/registry_with_vb.asp

hope that helps..
Imran.
"MVaughn" <MV*****@discussions.microsoft.com> wrote in message
news:69**********************************@microsof t.com...
Hello,

I've been reading this newsgroup for some time and have found all of you
very helpful and knowledgable. So, first and foremost, thank you for all
your
help you've provided and don't even realize it! Secondly, here's my
question...

I haven't seen this addressed so maybe it's common knowledge, and I'm just
a
moron, but here goes:

How do I add a key to the registry during runtime?

Here's the scenario:
The opens the program, it checks for a value in the registry. If the value
is not there, it prompts the user to register. After the user registers, I
need the program to store the created value in the appropriate key. That
way,
the next time the program is run, the user will not be prompted for
registration again.

The key to be created is called "Auth" and it is in the following
directory:
HKEY_LOCAL_MACHINE\Software\AppName

I know that SaveSetting will create a value, but it won't create it in a
specified directory.

Thank You All So Much for any help you can provide, and I'm looking
forward
to hearing from you. Thanks!

Jonathan


Nov 21 '05 #3

P: n/a
> Thank you again! I've been pulling my hair out with this for three days!

Glad that worked out for you :)
Nov 21 '05 #4

P: n/a
Try not to kill yourself next time!

"MVaughn" <MV*****@discussions.microsoft.com> wrote in message
news:69**********************************@microsof t.com...
Imran...you are my HERO!!

I've been looking and looking, but in ignorance...didn't know where to
look.
Thank you SO MUCH! It worked like a charm. I kept getting an error and
couldn't figure out why. Turns out, when I was opening my Subkey, I didn't
realize I had to set it to writeable by setting a value to True.

Thank you again! I've been pulling my hair out with this for three days!

Jonathan

"Imran Koradia" wrote:
Use the Registry Class under the Microsoft.Win32 namespace. Here are
couple
of samples:
http://www.freevbcode.com/ShowCode.asp?ID=4487
http://www.freevbcode.com/ShowCode.Asp?ID=174
http://www.codeproject.com/vb/net/registry_with_vb.asp

hope that helps..
Imran.
"MVaughn" <MV*****@discussions.microsoft.com> wrote in message
news:69**********************************@microsof t.com...
> Hello,
>
> I've been reading this newsgroup for some time and have found all of
> you
> very helpful and knowledgable. So, first and foremost, thank you for
> all
> your
> help you've provided and don't even realize it! Secondly, here's my
> question...
>
> I haven't seen this addressed so maybe it's common knowledge, and I'm
> just
> a
> moron, but here goes:
>
> How do I add a key to the registry during runtime?
>
> Here's the scenario:
> The opens the program, it checks for a value in the registry. If the
> value
> is not there, it prompts the user to register. After the user
> registers, I
> need the program to store the created value in the appropriate key.
> That
> way,
> the next time the program is run, the user will not be prompted for
> registration again.
>
> The key to be created is called "Auth" and it is in the following
> directory:
> HKEY_LOCAL_MACHINE\Software\AppName
>
> I know that SaveSetting will create a value, but it won't create it in
> a
> specified directory.
>
> Thank You All So Much for any help you can provide, and I'm looking
> forward
> to hearing from you. Thanks!
>
> Jonathan


Nov 21 '05 #5

P: n/a
"Christopher Kurtis Koeber" wrote:
Try not to kill yourself next time!


Lol...roger that! I was almost ready to kill something! (Namely the computer
by sailing it out the front door) Thanks Again everyone for all the help this
group has provided

Nov 21 '05 #6

This discussion thread is closed

Replies have been disabled for this discussion.