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. C#
  4. Reading Registry Key Problem.

Reading Registry Key Problem.

Scheduled Pinned Locked Moved C#
windows-admindebugginghelpquestionannouncement
2 Posts 2 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.
  • J Offline
    J Offline
    Jammer 0
    wrote on last edited by
    #1

    Hi All, I've been reading up on this and all the examples I can find show the exact method I'm using to read a value yet my value is never retrived. I'm checking the version of WMP installed on the system using: Microsoft.Win32.RegistryKey wmpRegKey = Microsoft.Win32.Registry.LocalMachine.CreateSubKey(@"SOFTWARE\Microsoft\Active Setup\Installed Components\{22d6f312-b0f6-11d0-94ab-0080c74c7e95}"); string wmpVersion = (string)wmpRegKey.GetValue("Version"); as soon as the last line is executed the wmpVersion won't even pop up a debugger widget and wmpRegKey won't either. Any Ideas?

    Jammer Going where everyone here has gone before! :) My Blog

    S 1 Reply Last reply
    0
    • J Jammer 0

      Hi All, I've been reading up on this and all the examples I can find show the exact method I'm using to read a value yet my value is never retrived. I'm checking the version of WMP installed on the system using: Microsoft.Win32.RegistryKey wmpRegKey = Microsoft.Win32.Registry.LocalMachine.CreateSubKey(@"SOFTWARE\Microsoft\Active Setup\Installed Components\{22d6f312-b0f6-11d0-94ab-0080c74c7e95}"); string wmpVersion = (string)wmpRegKey.GetValue("Version"); as soon as the last line is executed the wmpVersion won't even pop up a debugger widget and wmpRegKey won't either. Any Ideas?

      Jammer Going where everyone here has gone before! :) My Blog

      S Offline
      S Offline
      Sujith C Jose
      wrote on last edited by
      #2

      using Microsoft.Win32; //Statements (In your case) //------------------------------ RegistryKey Reg; //open the registry key Reg = Registry.LocalMachine.OpenSubKey(@"SOFTWARE\Microsoft\Active Setup\Installed Components\{22d6f312-b0f6-11d0-94ab-0080c74c7e95}"); //get the requested values if(Reg!=null) { string str1 = Reg.GetValue("Version").ToString(); MessageBox.Show(str1); } //close the key Reg.Close(); //Regards :)

      Sujith Blog 123

      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