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