How to read registry sub keys in Silverlight 4 OOB

1

I am creating an OOB Silverlight application where I need to read the sub keys from the registry. Although I have tried writing the code, it is not working. How can I read the subkeys from registry in SL4. Below is the screenshot of the code.

if (AutomationFactory.IsAvailable)
        {
            using (dynamic locatorService = AutomationFactory.CreateObject("WbemScripting.SWbemLocator"))
            {
                const uint HKEY_CURRENT_USER = 0x80000001;
                string strComputer = ".";
                dynamic wmiService = locatorService.ConnectServer(strComputer, @"root\DEFAULT");
                wmiService.Security_.ImpersonationLevel = 3;
                dynamic reg = wmiService.Get("StdRegProv");
                string strKeyPath = @"Software\Microsoft\Internet Explorer\TypedURLs";
                string[] sValue = new string[] { };
                uint result = reg.EnumKey(HKEY_CURRENT_USER, strKeyPath, out sValue);
                foreach (var item in sValue)
                {
                    MessageBox.Show(item);
                }
            }
        }
c#
silverlight
silverlight-4.0
asked on Stack Overflow Jan 18, 2012 by Jaikishan • edited Jan 20, 2012 by Chris

0 Answers

Nobody has answered this question yet.


User contributions licensed under CC BY-SA 3.0