473,652 Members | 3,045 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
txtNetworkDevel opmentPath.Text = ""
txtLiveLocalPat h.Text = ""
txtLiveNetworkP ath.Text = ""
'Try to open the given path
RegKeyRead = Registry.Curren tUser.OpenSubKe y("Software\\Ex cellence",
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\\Exce llence" =
RegKeyRead.GetV alue(txtNetwork DevelopmentPath .Text, "---Not
Found---").ToString
"Software\\Exce llence" = RegKeyRead.GetV alue(txtLiveLoc alPath.Text,
"---Not Found---").ToString
"Software\\Exce llence" =
RegKeyRead.GetV alue(txtLiveNet workPath.Text, "---Not Found---").ToString
'close the key
RegKeyRead.Clos e()

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

Could anybody possibly point me in the right direction? also on my Line
"MessageBox.Sho w("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 1536
Hi Mad,

I do it just like this
Dim RegKeyRead As RegistryKey
RegKeyRead = Registry.Curren tUser.CreateSub Key("Software\\ Excellence")

I hope this helps?

Cor
Nov 20 '05 #2
Sorry Cor,

Im confused? Would I do:

RegKeyRead = Registry.Curren tUser.GetValue( "Software\\Exce llence") =
(txtNetworkDeve lopmentPath.Tex t, "---Not Found---").ToString

Many Thanks Again
MCN

"Cor Ligthert" <no**********@p lanet.nl> wrote in message
news:OF******** ******@tk2msftn gp13.phx.gbl...
Hi Mad,

I do it just like this
Dim RegKeyRead As RegistryKey
RegKeyRead = Registry.Curren tUser.CreateSub Key("Software\\ Excellence")

I hope this helps?

Cor

Nov 20 '05 #3
Hi Mad,

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

pConn = RegKeyRead.GetV alue("ConnStrin g", "").ToStrin g

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\\Excel lence:

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\\Exce llence"

"Software\\Exce llence" = RegKeyRead.GetV alue(txtNetwork DevelopmentPath .Text,
"---Not Found---").ToString
"Software\\Exce llence" = RegKeyRead.GetV alue(txtLiveLoc alPath.Text, "---Not
Found---").ToString
"Software\\Exce llence" = RegKeyRead.GetV alue(txtLiveNet workPath.Text,
"---Not Found---").ToString

So Am I correct in thinking?

Dim RegKeyRead As RegistryKey
RegKeyRead = Registry.Curren tUser.GetValue( "Software\\Exce llence") - Loads
up the Reg Area ("Software\\Exc ellence")

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

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

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

pConn = RegKeyRead.GetV alue("ConnStrin g", "").ToStrin g

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\\Exce llence" = RegKeyRead.GetV alue(txtNetwork DevelopmentPath .Text, "---Not Found---").ToString


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

Do you mean
txtNetworkDevel opmentPath.Text = RegKeyRead.GetV alue(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:

txtNetworkDevel opmentPath.Text = RegKeyRead.GetV alue(NetDevPath , "----Not
Found---").toString
txtLiveLocalPat h.Text = RegKeyRead.GetV alue(LiveLocalP ath, "----Not
Found---").toString
txtLiveNetworkP ath.Text = RegKeyRead.GetV alue(LiveNetwor kPath, "----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**********@p lanet.nl> wrote in message
news:ue******** ******@TK2MSFTN GP11.phx.gbl...
Hi Mad,

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

RegKeyRead.GetV alue(txtNetwork DevelopmentPath .Text,
"---Not Found---").ToString


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

Do you mean
txtNetworkDevel opmentPath.Text = RegKeyRead.GetV alue(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.co m> scripsit:
'Try to open the given path
RegKeyRead = Registry.Curren tUser.OpenSubKe y("Software\\Ex cellence",


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.co m> scripsit:
'Try to open the given path
RegKeyRead =
Registry.Curren tUser.OpenSubKe y("Software\\Ex cellence",
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
12352
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 guidelines for how to do this?
3
4297
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 values in another column of a listbox? Thanks!
0
3509
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 contained within the registry view (right click the install project and navigate to View->Registry). However, if the user runs the setup.exe again, I don't want the registry values to be overwritten if they have been changed. Thus, I am trying...
0
1775
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 installer to run through a number of custom screens with custom controls. I'd like those contols' values to be saved to the registry.
1
1736
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 Access is not allowed" so then i changed impersonate to "true" and it is reading values from the registry and writing into the registry. but when i runing the same aplication in same system now am getting the exception "requested registry access...
3
1793
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. Dim aKey As RegistryKey aKey = Registry.CurrentUser.OpenSubKey("software\myApplication") I then attempt to read in any existing values
6
1677
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 object with 10 string items into the registry and retreive them later. I tried this: key.SetValue("lstNSXitems", lstNSX.Items) where "lstNSXitems" is the name of the subkey, and lstNSX.Items is the
9
2084
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 http://www.sarc.com
2
2815
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 startup, and change the values during the application. In Vista, I CANNOT see the values using RegEdit but I can read the values using the application. I created some values using RegEdit in the place where my values would be. Now I can see them...
11
7512
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 through HKEY_LOCAL_MACHINE and read one subkey at a time, if it contains this 'foo' then change it into 'moo'). As I already said, I am by no means an expert in Python (heck, I learned the basics only a month ago). However, I am willing to learn.
0
8367
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8811
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8703
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8467
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8589
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7302
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6160
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5619
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
1
2703
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

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.