[Resolved] reading reg values
I'm attempting to write an application which reads all sub keys from
HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Uninstall\
I am managing to retrieve all the subkey names fine, however when I want to retrieve a value from within this I get nothing.
My code is as follows:
Code:
Dim regkey As RegistryKey
regkey = Registry.LocalMachine.OpenSubKey("Software\Microsoft\Windows\CurrentVersion\Uninstall\", True)
Dim key As String
Dim test As String
For Each key In regkey.GetSubKeyNames()
test = CType(regkey.GetValue(key & "\InstallDate"), String)
TextBox2.Text = TextBox2.Text & vbCrLf & key & " - '" & test & "'"
Next
I've only tried the CType bit as I read that you need to convert a registry value to string to be able to read it.
A result is as follows
CNXT_MODEM_HDAUDIO_VEN_14F1&DEV_2BFA&SUBSYS_14F100C3 - ''
Combined Community Codec Pack_is1 - ''
Connection Manager - ''
DirectAnimation - ''
DirectDrawEx - ''
DXM_Runtime - ''
some of these obviously dont have a value for InstallDate however I know for sure that the Combined Community Codec Pack_is1 has a value for this.
Any help is gratefully appreciated.
Re: [Resolved] reading reg values
would this work with .net v1.1 as I've just found out that v2.0 will not be available on users machines and cannot be installed either.
Re: [Resolved] reading reg values
Yes, it's the same code for .NET 1.1. It's using the Microsoft.Win32 namespace after all.
Re: [Resolved] reading reg values
ah cheers, just edited the references to v1.1 and its broke other stuff, will fix that. Cheers :)