none
Access to the registry key 'HKEY_LOCAL_MACHINE\SOFTWARE\My Registry Key' is denied. RRS feed

  • Question

  • I am trying to create my new registry using following line

    Registry.LocalMachine.CreateSubKey("SOFTWARE\\My Registry Key");

    but i got this error

    Access to the registry key 'HKEY_LOCAL_MACHINE\SOFTWARE\My Registry Key' is denied.

    why this?

    and how to solve this problem?


    sonalism

    Wednesday, July 25, 2012 6:32 AM

Answers

  • I am trying to create my new registry using following line

    Registry.LocalMachine.CreateSubKey("SOFTWARE\\My Registry Key");

    but i got this error

    Access to the registry key 'HKEY_LOCAL_MACHINE\SOFTWARE\My Registry Key' is denied.

    why this?

    and how to solve this problem?


    sonalism

    problem has solved now

    i used this code

       Microsoft.Win32.RegistryKey mykey;
                mykey = Microsoft.Win32.Registry.CurrentUser.CreateSubKey("My Registry Key");
                mykey.SetValue("My Registry Key","123456");
                mykey.Close();


    sonalism

    sonali sudhakar mahadik


    • Edited by Sonu(India) Wednesday, July 25, 2012 7:18 AM
    • Marked as answer by Sonu(India) Wednesday, July 25, 2012 7:18 AM
    Wednesday, July 25, 2012 7:04 AM