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. How to access Registry in VB.NET?

How to access Registry in VB.NET?

Scheduled Pinned Locked Moved Visual Basic
questioncsharpwindows-adminhelp
4 Posts 4 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.
  • C Offline
    C Offline
    ccoppin
    wrote on last edited by
    #1

    Simple question that has me stumped. Help! Chris

    A 1 Reply Last reply
    0
    • C ccoppin

      Simple question that has me stumped. Help! Chris

      A Offline
      A Offline
      Andy H
      wrote on last edited by
      #2

      Have a look at the article "Registry handling with .NET" by S Nishant in this site (www.codeproject.com/dotnet/csregistry01.asp). The VB.NET equivalent is virtually identical. Imports Microsoft.Win32.Registry Imports Microsoft.Win32.RegistryKey Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Dim rKey As Microsoft.Win32.RegistryKey Dim rKey1 As Microsoft.Win32.RegistryKey rKey = Microsoft.Win32.Registry.LocalMachine rKey1 = rKey.OpenSubKey("SOFTWARE\Microsoft\Windows NT\CurrentVersion") ListBox1.Items.Add("RegisteredOwner :- " + rKey1.GetValue("RegisteredOwner")) ListBox1.Items.Add("RegisteredOrganization :- " + rKey1.GetValue("RegisteredOrganization")) ListBox1.Items.Add("ProductName :- " + rKey1.GetValue("ProductName")) ListBox1.Items.Add("CSDVersion :- " + rKey1.GetValue("CSDVersion")) ListBox1.Items.Add("SystemRoot :- " + rKey1.GetValue("SystemRoot")) rKey1.Close() End Sub HTH Andy

      N 1 Reply Last reply
      0
      • A Andy H

        Have a look at the article "Registry handling with .NET" by S Nishant in this site (www.codeproject.com/dotnet/csregistry01.asp). The VB.NET equivalent is virtually identical. Imports Microsoft.Win32.Registry Imports Microsoft.Win32.RegistryKey Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Dim rKey As Microsoft.Win32.RegistryKey Dim rKey1 As Microsoft.Win32.RegistryKey rKey = Microsoft.Win32.Registry.LocalMachine rKey1 = rKey.OpenSubKey("SOFTWARE\Microsoft\Windows NT\CurrentVersion") ListBox1.Items.Add("RegisteredOwner :- " + rKey1.GetValue("RegisteredOwner")) ListBox1.Items.Add("RegisteredOrganization :- " + rKey1.GetValue("RegisteredOrganization")) ListBox1.Items.Add("ProductName :- " + rKey1.GetValue("ProductName")) ListBox1.Items.Add("CSDVersion :- " + rKey1.GetValue("CSDVersion")) ListBox1.Items.Add("SystemRoot :- " + rKey1.GetValue("SystemRoot")) rKey1.Close() End Sub HTH Andy

        N Offline
        N Offline
        Nic Rowan
        wrote on last edited by
        #3

        Heya - I also had a bit of trouble with the registry. I can modify it easy enough but I can't get it to refresh without restarting the computer. Is there some way to force Windows to reload the registry without restarting? :confused: Thanks Nic R_

        ------------------------------------------ I beat the internet - the end guy is hard.

        _

        N 1 Reply Last reply
        0
        • N Nic Rowan

          Heya - I also had a bit of trouble with the registry. I can modify it easy enough but I can't get it to refresh without restarting the computer. Is there some way to force Windows to reload the registry without restarting? :confused: Thanks Nic R_

          ------------------------------------------ I beat the internet - the end guy is hard.

          _

          N Offline
          N Offline
          Nish Nishant
          wrote on last edited by
          #4

          Some of the system settings are read from the registry ONLY during windows logon/boot-up. That's why some apps force you to restart Windows after installation. Nish


          Author of the romantic comedy Summer Love and Some more Cricket [New Win] Review by Shog9 Click here for review[NW]

          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