Note that there are some explanatory texts on larger screens.

plurals
  1. POProgrammatically Set Proxy Address, Port, User, Password throught Windows Registry
    primarykey
    data
    text
    <p>I'm writing a small C# application that will use Internet Explorer to interact with a couple a websites, with help from <a href="http://watin.sourceforge.net/" rel="nofollow noreferrer">WatiN</a>.</p> <p>However, it will also require from time to time to use a proxy.</p> <p>I've came across <a href="https://stackoverflow.com/questions/197725/programmatically-set-browser-proxy-settings-in-c">Programmatically Set Browser Proxy Settings in C#</a>, but this only enables me to enter a proxy address, and I also need to enter a Proxy username and password. How can I do that?</p> <p>Note:</p> <ul> <li>It doesn't matter if a solution changes the entire system Internet settings. However, I would prefer to change only IE proxy settings (for any connection).</li> <li>The solution has to work with IE8 and Windows XP SP3 or higher.</li> <li>I'd like to have the possibility to read the Proxy settings first, so that later I can undo my changes.</li> </ul> <p><strong>EDIT</strong></p> <p>With the help of the Windows Registry accessible through <code>Microsoft.Win32.RegistryKey</code>, i was able to apply a proxy something like this:</p> <pre><code>RegistryKey registry = Registry.CurrentUser.OpenSubKey("Software\\Microsoft\\Windows\\CurrentVersion\\Internet Settings", true); registry.SetValue("ProxyEnable", 1); registry.SetValue("ProxyServer", "127.0.0.1:8080"); </code></pre> <p>But how can i specify a username and a password to login at the proxy server?</p> <p>I also noticed that IE doesn't refresh the Proxy details for its connections once the registry was changed how can i order IE to refresh its connection settings from the registry?</p> <p>Thanks</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload