Accessing registry
-
I am trying to change values of margins in Registry using C# but for path Software\\microsoft\\internet explorer\\pagesetup i got null reference, in regedit list i have path. Code which I am using is:
RegistryKey pk = Registry.CurrentUser.OpenSubKey("Software\\microsoft\\internet explorer\\pagesetup", true); pk.SetValue("margin_top", "0.20000");
Is there permisions case or anything else? How can I solve it? Thanks in help to everyone.
I Love SQL
-
I am trying to change values of margins in Registry using C# but for path Software\\microsoft\\internet explorer\\pagesetup i got null reference, in regedit list i have path. Code which I am using is:
RegistryKey pk = Registry.CurrentUser.OpenSubKey("Software\\microsoft\\internet explorer\\pagesetup", true); pk.SetValue("margin_top", "0.20000");
Is there permisions case or anything else? How can I solve it? Thanks in help to everyone.
I Love SQL
-
I tried on admin User it worked... sending you the code.. RegistryKey r = Registry.CurrentUser; RegistryKey r1 = r.OpenSubKey("Software\\Microsoft\\Internet Explorer\\Page Setup",true); r1.SetValue("Mykey", ".Net"); r1.Close(); Vikram I Code...;)
Thanks for your reply. I can figure that if user is not admin then user can not change values in registy so I'm gonna leave this option and as option I will call Print Preview with javascript. If you ever have called Print Preview with Javascritp plz share me code. Regards
I Love SQL
-
I tried on admin User it worked... sending you the code.. RegistryKey r = Registry.CurrentUser; RegistryKey r1 = r.OpenSubKey("Software\\Microsoft\\Internet Explorer\\Page Setup",true); r1.SetValue("Mykey", ".Net"); r1.Close(); Vikram I Code...;)