473,503 Members | 1,813 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Registry Values

Hey Group,

Im trying to load up some registry Values and display them in Text Box's:

Here is my Code:

Dim RegKeyRead As RegistryKey
'reset the resulting textbox
txtNetworkDevelopmentPath.Text = ""
txtLiveLocalPath.Text = ""
txtLiveNetworkPath.Text = ""
'Try to open the given path
RegKeyRead = Registry.CurrentUser.OpenSubKey("Software\\Excelle nce",
True)
If RegKeyRead Is Nothing Then
'if the path doesn't exist, warn the user
MessageBox.Show("Error Found")
Exit Sub
End If
'retrieve the subkey and its value (alone with a default value if
the subkey is not found)
"Software\\Excellence" =
RegKeyRead.GetValue(txtNetworkDevelopmentPath.Text , "---Not
Found---").ToString
"Software\\Excellence" = RegKeyRead.GetValue(txtLiveLocalPath.Text,
"---Not Found---").ToString
"Software\\Excellence" =
RegKeyRead.GetValue(txtLiveNetworkPath.Text, "---Not Found---").ToString
'close the key
RegKeyRead.Close()

Only problem is I get a Sysntax Error on "Software\\Excellence".

Could anybody possibly point me in the right direction? also on my Line
"MessageBox.Show("Error Found") How could I get it to tell me which Reg Key
was not found?

Many Many Thanks
MCN
Nov 20 '05 #1
9 1522
Hi Mad,

I do it just like this
Dim RegKeyRead As RegistryKey
RegKeyRead = Registry.CurrentUser.CreateSubKey("Software\\Excel lence")

I hope this helps?

Cor
Nov 20 '05 #2
Sorry Cor,

Im confused? Would I do:

RegKeyRead = Registry.CurrentUser.GetValue("Software\\Excellenc e") =
(txtNetworkDevelopmentPath.Text, "---Not Found---").ToString

Many Thanks Again
MCN

"Cor Ligthert" <no**********@planet.nl> wrote in message
news:OF**************@tk2msftngp13.phx.gbl...
Hi Mad,

I do it just like this
Dim RegKeyRead As RegistryKey
RegKeyRead = Registry.CurrentUser.CreateSubKey("Software\\Excel lence")

I hope this helps?

Cor

Nov 20 '05 #3
Hi Mad,

I thought it was the first Software\\Excellence that did give the errror,
however as thirth row I have than in a program

pConn = RegKeyRead.GetValue("ConnString", "").ToString

The second parameter is the default.

Do you understand it when you see this?

Cor
Nov 20 '05 #4
Sorry Cor i think im confusing you:

I have in My Registry 3 Values under Software\\Excellence:

1. NetDevPath with Value of "J:\DevDB"
2. LiveLocalPath with a Value of "C:\LocalLiveDB"
3. LiveNetPath with a Value of "J:\LiveDB"

All the following lines give Syntax Errors on "Software\\Excellence"

"Software\\Excellence" = RegKeyRead.GetValue(txtNetworkDevelopmentPath.Text ,
"---Not Found---").ToString
"Software\\Excellence" = RegKeyRead.GetValue(txtLiveLocalPath.Text, "---Not
Found---").ToString
"Software\\Excellence" = RegKeyRead.GetValue(txtLiveNetworkPath.Text,
"---Not Found---").ToString

So Am I correct in thinking?

Dim RegKeyRead As RegistryKey
RegKeyRead = Registry.CurrentUser.GetValue("Software\\Excellenc e") - Loads
up the Reg Area ("Software\\Excellence")

But how do I put the NetDevPath key Value into my txtNetworkDevelopmentPath
Text Box, and so on with LiveLocalPath and LiveNetPath?

Many Thanks
MCN
"Cor Ligthert" <no**********@planet.nl> wrote in message
news:%2****************@tk2msftngp13.phx.gbl...
Hi Mad,

I thought it was the first Software\\Excellence that did give the errror,
however as thirth row I have than in a program

pConn = RegKeyRead.GetValue("ConnString", "").ToString

The second parameter is the default.

Do you understand it when you see this?

Cor

Nov 20 '05 #5
Hi Mad,

Yes you confusing me, because I do not understand this code.
"Software\\Excellence" = RegKeyRead.GetValue(txtNetworkDevelopmentPath.Text , "---Not Found---").ToString


That is something as
"MadCrazy" = "Doing Crazy"

Do you mean
txtNetworkDevelopmentPath.Text = RegKeyRead.GetValue(NetDevPath,"----Not
Found---").toString

I get the idea, that it is or very late at your place or that it maybe has
been very late.

Or maybe I see something not.

:-))

Cor
Nov 20 '05 #6
Hi Cor,

Yer sorry not late is about 12:00 dinner, just been an earlie morning:(

Now I have:

txtNetworkDevelopmentPath.Text = RegKeyRead.GetValue(NetDevPath, "----Not
Found---").toString
txtLiveLocalPath.Text = RegKeyRead.GetValue(LiveLocalPath, "----Not
Found---").toString
txtLiveNetworkPath.Text = RegKeyRead.GetValue(LiveNetworkPath, "----Not
Found---").toString

But in now Tells me that NetDevPath, LiveLocalPath, & LiveNetworkPath arn`t
Declared, how do I Declare them?

Is it just a Case of:

Dim NetDevPath As RegistaryKey?

Many Thanks
MCN

"Cor Ligthert" <no**********@planet.nl> wrote in message
news:ue**************@TK2MSFTNGP11.phx.gbl...
Hi Mad,

Yes you confusing me, because I do not understand this code.
"Software\\Excellence" =

RegKeyRead.GetValue(txtNetworkDevelopmentPath.Text ,
"---Not Found---").ToString


That is something as
"MadCrazy" = "Doing Crazy"

Do you mean
txtNetworkDevelopmentPath.Text = RegKeyRead.GetValue(NetDevPath,"----Not
Found---").toString

I get the idea, that it is or very late at your place or that it maybe has
been very late.

Or maybe I see something not.

:-))

Cor

Nov 20 '05 #7
Hi Mad,

I made them as a dataname, however I asume you want them between quotes,
just as a name.

Cor
Nov 20 '05 #8
* "MadCrazyNewbie" <te**@nospam.com> scripsit:
'Try to open the given path
RegKeyRead = Registry.CurrentUser.OpenSubKey("Software\\Excelle nce",


Replace the "\\" with "\" and try again.

--
Herfried K. Wagner [MVP]
<URL:http://dotnet.mvps.org/>
Nov 20 '05 #9
Cheers Cor & Herfried, its working like dream now:)

Many Thanks
MCN

"Herfried K. Wagner [MVP]" <hi***************@gmx.at> wrote in message
news:2g***********@uni-berlin.de...
* "MadCrazyNewbie" <te**@nospam.com> scripsit:
'Try to open the given path
RegKeyRead =
Registry.CurrentUser.OpenSubKey("Software\\Excelle nce",
Replace the "\\" with "\" and try again.

--
Herfried K. Wagner [MVP]
<URL:http://dotnet.mvps.org/>

Nov 20 '05 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

8
12329
by: Bob Kirkwood | last post by:
I believe the intent in .NET is that we store application setup information in an XML file now instead of the Registry or INI files. Is this correct? Are there any tools, sample apps, or...
3
4284
by: vbMark | last post by:
Hello, In regards to the Registry... Can someone give me an example of how to list an unknown number of subkeys under a key, and put the key names in one column of a listbox, and the key...
0
3503
by: D. Yates | last post by:
Hi, How exactly do you use the condition property to tell the installer not to overwrite changed registry values? Initially, I want certain registry values within a given key set to the value...
0
1762
by: ahaupt | last post by:
Hi all, I've created a setup project for my app in VS2003 and need to set up some registry values and keys. It is easy enough to just create static keys with static values, but I'd like the...
1
1729
by: Yoshitha | last post by:
Hi I am developing web application through which i've to write and read the values from the registry. When i set impersonate property to "false" it is displaying exception " Requested Registry...
3
1786
by: Aussie Rules | last post by:
Hi, I want to store some data in the registry, however I have not been able to do this, and think my logic maybe flawed. Firstly I try to open the registry and read in any existing values....
6
1670
by: JOSII | last post by:
Getting a string of boolean value into and out of the registry is no problem. Here's the problem: Although you can place an object into the registry and retreive it, I need to place an ArrayList...
9
2080
by: Newbie Coder | last post by:
Hello Newsgroup Readers I would like to know how to go & do the following: I have a certain registry key that has sub values Example: Key1 http://www.microsoft.com Key2 ...
2
2806
by: terryastone | last post by:
I have an application that reads some registry values stored in the Local Machine\Software\... key. In XP, I can see these values using RegEdit. In my application I can read the values at...
11
7483
by: Unknown Hero | last post by:
Tim Golden wrote: The first link which points to the Python documentation for the _winreg module I already checked, even before coming here. I am wondering how I should do the loop I need (go...
0
7202
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7086
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7330
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
7460
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5578
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
5014
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
3167
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3154
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
380
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.