Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. Visual Basic
  4. Scanning/Enumeration of Registry keys

Scanning/Enumeration of Registry keys

Scheduled Pinned Locked Moved Visual Basic
windows-admintutorial
7 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    sonia sardana
    wrote on last edited by
    #1

    Can somebody tell me the code how to scan a registry.

    T 1 Reply Last reply
    0
    • S sonia sardana

      Can somebody tell me the code how to scan a registry.

      T Offline
      T Offline
      Tony Richards
      wrote on last edited by
      #2

      Assuming you're using VB .Net, seeing as you don't actually say, take a look at the Registry classes in the Microsoft.Win32.Registry namespace.

      S 1 Reply Last reply
      0
      • T Tony Richards

        Assuming you're using VB .Net, seeing as you don't actually say, take a look at the Registry classes in the Microsoft.Win32.Registry namespace.

        S Offline
        S Offline
        sonia sardana
        wrote on last edited by
        #3

        Hey frnd i want to know that in VB there is no registry inbuilt fn. Rite??? In Vb.net i import namespace imports.win32 tell me dat how to create the object for registry class.

        T 1 Reply Last reply
        0
        • S sonia sardana

          Hey frnd i want to know that in VB there is no registry inbuilt fn. Rite??? In Vb.net i import namespace imports.win32 tell me dat how to create the object for registry class.

          T Offline
          T Offline
          Tony Richards
          wrote on last edited by
          #4

          I'm sorry, I don't understand what you mean. Are you working with Visual Basic .NET or Visual Basic 6 (or earlier)?

          S 1 Reply Last reply
          0
          • T Tony Richards

            I'm sorry, I don't understand what you mean. Are you working with Visual Basic .NET or Visual Basic 6 (or earlier)?

            S Offline
            S Offline
            sonia sardana
            wrote on last edited by
            #5

            I m working with .Net, I want to know from where to start as i do not have any idea.After creating the object,what is the next step.

            T S 2 Replies Last reply
            0
            • S sonia sardana

              I m working with .Net, I want to know from where to start as i do not have any idea.After creating the object,what is the next step.

              T Offline
              T Offline
              Tony Richards
              wrote on last edited by
              #6

              As I'm not aware of what your trying to achieve, overall, I can't really suggest anything except taking a look at the MSDN documentation for the classes and finding something that meets your needs. Google is also your friend if you have a specific aim in mind that someone might have done before. Then, if you've got a specific question, ask again. Like most people here I won't give out code until you've got something to show you've had a go yourself first. To give a pointer, though, the Registry Object includes members that encapsulate the various parts of the Registry, and you can loop over them like any other Collection.

              1 Reply Last reply
              0
              • S sonia sardana

                I m working with .Net, I want to know from where to start as i do not have any idea.After creating the object,what is the next step.

                S Offline
                S Offline
                Steven J Jowett
                wrote on last edited by
                #7

                The following code demonstrates how to read a registry entry. You should be able to build on it to incorporate Write, Delete etc. Public Enum Root As Byte CurrentUser = 1 LocalMachine = 2 CurrentConfig = 3 ClassesRoot = 4 Users = 5 End Enum Function ReadEntry(ByVal RegistryRoot As Root, ByVal Location As String, ByVal Name As String) As String Dim regKey As Microsoft.Win32.RegistryKey Select Case RegistryRoot Case Root.CurrentUser regKey = Microsoft.Win32.Registry.CurrentUser.OpenSubKey(Location) Case Root.LocalMachine regKey = Microsoft.Win32.Registry.LocalMachine.OpenSubKey(Location) Case Root.CurrentConfig regKey = Microsoft.Win32.Registry.CurrentConfig.OpenSubKey(Location) Case Root.ClassesRoot regKey = Microsoft.Win32.Registry.ClassesRoot.OpenSubKey(Location) Case Root.Users regKey = Microsoft.Win32.Registry.Users.OpenSubKey(Location) Case Else regKey = Nothing End Select If regKey Is Nothing Then ReadEntry = Nothing Else Try ReadEntry = regKey.GetValue(Name).ToString regKey.Close() Catch Return Nothing End Try End If End Function

                Steve Jowett ------------------------- It is offen dangerous to try and see someone else's point of view, without proper training. Douglas Adams (Mostly Harmless)

                1 Reply Last reply
                0
                Reply
                • Reply as topic
                Log in to reply
                • Oldest to Newest
                • Newest to Oldest
                • Most Votes


                • Login

                • Don't have an account? Register

                • Login or register to search.
                • First post
                  Last post
                0
                • Categories
                • Recent
                • Tags
                • Popular
                • World
                • Users
                • Groups