Hi Michael,
I'm wondering if there is a way to duplicate a function in regedit
of find and find next for keywords programmatically, then to list
them in a treeview or listbox?
I am afraid there hasn't been a sample by hand to do this, the general
approach is to enumerate all the registry keys/subkys and their values for
the target data you want to find.
You can use the RegistryKey.GetSubKeyNames to enumerate a specific key
(e.g. HKCU), then enumerate each of its subkey recursively. Once you get a
leaf subkey (which hasn't its own subkeys), you can use the
RegistryKey.GetValueNames to get all of its value names and then use the
RegistryKey.GetValue to retrieve their values.
The following MSDN documentation contains the code snippets on using the
above FCL methods:
RegistryKey.GetSubKeyNames Method
http://msdn2.microsoft.com/en-us/library/microsoft.win32.registrykey.getsubk
eynames.aspx
RegistryKey.GetValueNames Method
http://msdn2.microsoft.com/en-us/library/microsoft.win32.registrykey.getvalu
enames.aspx
By the way, if you are not very familiar about how to populate a treeview
control in VB.NET, you can refer to the following samples:
http://abstractvb.com/code.asp?A=967
http://www.startvbdotnet.com/controls/treeview.aspx
I hope the above information helps, if you have any questions or concerns,
please do not hesitate to let me know. I am standing by to help you.
Thanks!
Best regards,
Gary Chang
Microsoft Online Community Support
==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#notif
ications.
Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscriptions/support/default.aspx.
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.