Xtreme Visual Basic Talk

Xtreme Visual Basic Talk (http://www.xtremevbtalk.com/)
-   .NET File I/O and Registry (http://www.xtremevbtalk.com/-net-file-i-o-and-registry/)
-   -   Read a part of the registry (http://www.xtremevbtalk.com/-net-file-i-o-and-registry/326821-read-registry.html)

winmaster 02-08-2014 03:48 AM

Read a part of the registry
 
Hello everyone,

I have searched a lot today but I can't find anything in help. I want to build an app that will provide information from one part of the registry.

So what I mean? I mean that when I open the app I want to see all of the information from example HKEY_LOCAL_MACHINE --> Software --> Microsoft --> Windows --> CurrentVersion.

Is there any way to do that? I can't find anywhere. Thanks for the help in advance.

PlausiblyDamp 02-08-2014 08:31 AM

The following snippet might get you started
Code:

        Dim regKey As RegistryKey

        regKey = Registry.LocalMachine.OpenSubKey("Software\Microsoft\Windows\CurrentVersion")

        Debug.WriteLine("***Subkeys***")
        For Each x In regKey.GetSubKeyNames
            Debug.WriteLine(x)
        Next

        Debug.WriteLine("***Value names***")
        For Each x In regKey.GetValueNames
            Debug.WriteLine(x)
        Next


winmaster 02-11-2014 01:32 PM

Okay, that was very helpful. But I have two more questions:
1. Is there a way to show only one registry line and 2. how to display this information

PlausiblyDamp 02-11-2014 05:33 PM

The above code was just to give an idea of how you could access the registry, to answer your questions though...

1. Yes, don't loop over the lines use the properties / methods of the RegistryKey variable to access the value you are after.

2. Depends on where you want to display it really.

winmaster 02-15-2014 02:38 AM

Okay, I'll try some things. Anyway - thanks for the help :)


All times are GMT -6. The time now is 12:17 AM.

Powered by vBulletin® Version 3.8.9
Copyright ©2000 - 2017, vBulletin Solutions, Inc.
Search Engine Optimisation provided by DragonByte SEO v2.0.15 (Lite) - vBulletin Mods & Addons Copyright © 2017 DragonByte Technologies Ltd.
All site content is protected by the Digital Millenium Act of 1998. Copyright©2001-2011 MAS Media Inc. and Extreme Visual Basic Forum. All rights reserved.
You may not copy or reproduce any portion of this site without written consent.