i foud this code , its work well in windows 7 but when i run project in windows xp its says i must use New keyword but when i use New its gives error at regkey.GetValueNames and RegistryKey = Registry.LocalMachine and regBaseKey.OpenSubKey("SOFTWARE\MyApp", FalseImports Microsoft.Win32
Public Class mform
Dim regBaseKey As RegistryKey = Registry.LocalMachine
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim regkey As RegistryKey = regBaseKey.OpenSubKey("SOFTWARE\MyApp", False)
ListBox2.Items.AddRange(regkey.GetValueNames)
End Sub
end class
when i add New keyword , its right like this ?
Imports Microsoft.Win32
Public Class mform
Dim regBaseKey new As RegistryKey = Registry.LocalMachine
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim regkey As new RegistryKey = regBaseKey.OpenSubKey("SOFTWARE\MyApp", False)
ListBox2.Items.AddRange(regkey.GetValueNames)
End Sub