locked
How to set the Registry Path in Windows 7 OS? RRS feed

  • Question

  • In my windows application I set the registry value.. It works fine in Windows XP.. But doesn't work in Windows 7 OS.. This is my code... Kindly check my code... My windows 7 os is 32-bit....

            string assi = "";

            private void SplashTimer_Tick(object sender, EventArgs e)
            {
                ProgressBar1.Value += 4;


                if (ProgressBar1.Value == 100)
                {
                    SplashTimer.Dispose();

                    this.Visible = false;

                    using (Microsoft.Win32.RegistryKey key = Microsoft.Win32.Registry.LocalMachine.CreateSubKey(@"SOFTWARE\Microsoft\DVP"))
                    {
                        assi = (String)key.GetValue("assign");
                        if (assi == null)
                        {
                            frmProductName objPN = new frmProductName();
                            objPN.ShowDialog();

                        }
                        else
                        {
                            frmLogin objLog = new frmLogin();
                            objLog.Show();
                        }


                    }
                }
            }
       
    Veera
    Wednesday, August 17, 2011 5:20 AM

Answers

  • It appears that you have a C# programming question. As you have the source code, I think you'll get the best help if you ask in the developer forums, here:

    http://social.msdn.microsoft.com/Forums/en-US/category/visualcsharp

    When you post there, be sure to include the details of what error you get in Windows 7 and which statement in your code causes the error.

     

    • Proposed as answer by Juke Chou Friday, August 19, 2011 8:40 AM
    • Marked as answer by Juke Chou Sunday, September 4, 2011 1:33 PM
    Wednesday, August 17, 2011 1:52 PM

All replies

  • It appears that you have a C# programming question. As you have the source code, I think you'll get the best help if you ask in the developer forums, here:

    http://social.msdn.microsoft.com/Forums/en-US/category/visualcsharp

    When you post there, be sure to include the details of what error you get in Windows 7 and which statement in your code causes the error.

     

    • Proposed as answer by Juke Chou Friday, August 19, 2011 8:40 AM
    • Marked as answer by Juke Chou Sunday, September 4, 2011 1:33 PM
    Wednesday, August 17, 2011 1:52 PM
  • Your code tries to create a subkey in HKLocalMachine. Do you run the code with administrative power or with standard user rights? Please verify utilizing Proccess Explorer or Task Manager.
    Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread.
    Thursday, August 18, 2011 7:35 PM