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 5 956
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
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
> Thank you again! I've been pulling my hair out with this for three days!
Glad that worked out for you :)
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
"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 This discussion thread is closed Replies have been disabled for this discussion. Similar topics
1 post
views
Thread by Omer Ahmad |
last post: by
|
3 posts
views
Thread by vighnesh |
last post: by
|
8 posts
views
Thread by Al Kaufman |
last post: by
|
3 posts
views
Thread by Ravi |
last post: by
|
3 posts
views
Thread by Mark Findlay |
last post: by
|
reply
views
Thread by bazzer |
last post: by
|
5 posts
views
Thread by Parv |
last post: by
|
6 posts
views
Thread by JOSII |
last post: by
|
reply
views
Thread by tmsprowl |
last post: by
|
9 posts
views
Thread by Newbie Coder |
last post: by
| | | | | | | | | | |