Search code examples
asp.netregistryregistrykey

Accessing the Print_Background registry key locally in ASP.Net


In an ASP.Net 4.5.1 web application, I want to change the value of the Print_Background registry key to "yes" so that background highlighting will print for the user. However, my understanding is that the following code:

RegistryKey regKey = Registry.CurrentUser
                                .OpenSubKey("Software", true)
                                .OpenSubKey("Microsoft", true)
                                .OpenSubKey("Internet Explorer", true)
                                .OpenSubKey("PageSetup", true);
        defaultValue = regKey.GetValue("Print_Background");
        regKey.SetValue("Print_Background", "yes");

will execute on the server the web application is hosted from, whereas the Print_Background registry key needs to be set on the user's machine for the setting to have effect. Is there a way to set this key's value on the user's local machine? The web application is hosted on a Windows 2008 Standard server and the user's machine is a Windows 7 machine.


Solution

  • No there's not. Thank goodness. It would be a security nightmare. After all the registry contains password policies, usernames, encryption keys, and all sorts of other things the web has no business knowing or changing.