Registary Values

M

MadCrazyNewbie

Hey Again Group,

Im using the folowing code to pull some Values from my Registary:

RegKeyRead = Registry.CurrentUser.OpenSubKey("Software\Excellence", True)
txt1.Text = RegKeyRead.GetValue("C:\1.txt", "----Not Found----").ToString
txt2.Text = RegKeyRead.GetValue("C:\2.txt", "----Not Found----").ToString
txt3.Text = RegKeyRead.GetValue("C:\3.txt3", "----Not Found----").ToString

I would like to be able to use a ComboBox with the foloowing values:

Load 1, Load 2, Load 3

And have it look at my reg values above to get the file payj.

The only think is i don`t want to use Textbox`s, how would i do the above
without using any type of control to first hold the file path, if you get
what i mean?

Thanks
MCN
 
K

Ken Tucker [MVP]

Hi,

Try something like this.

Dim arValues(2) As String

Dim RegKeyRead As RegistryKey =
Registry.CurrentUser.OpenSubKey("Software\Excellence", True)

arValues(0) = RegKeyRead.GetValue("C:\1.txt", "----Not
Found----").ToString

arValues(1) = RegKeyRead.GetValue("C:\2.txt", "----Not
Found----").ToString

arValues(2) = RegKeyRead.GetValue("C:\3.txt3", "----Not
Found----").ToString

combobox1.datasource = arValues

Ken
------------------
 
H

Herfried K. Wagner [MVP]

* "MadCrazyNewbie said:
Im using the folowing code to pull some Values from my Registary:

RegKeyRead = Registry.CurrentUser.OpenSubKey("Software\Excellence", True)
txt1.Text = RegKeyRead.GetValue("C:\1.txt", "----Not Found----").ToString
txt2.Text = RegKeyRead.GetValue("C:\2.txt", "----Not Found----").ToString
txt3.Text = RegKeyRead.GetValue("C:\3.txt3", "----Not Found----").ToString

I would like to be able to use a ComboBox with the foloowing values:

Load 1, Load 2, Load 3

And have it look at my reg values above to get the file payj.

The only think is i don`t want to use Textbox`s, how would i do the above
without using any type of control to first hold the file path, if you get
what i mean?

\\\
Private m_Path1 As String
..
..
..
m_Path1 = RegKeyRead.GetValue(...)
..
..
..
///
 

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