How can I programmatically set the proxy username and password in IE using C#. The problem is it asks me everytime, I open an IE instance and start browsing a page.
Asked
Active
Viewed 3,160 times
0
-
I'm betting it depends on the kind of proxy and its authentication mechanism. Can you provide more details ? I also bet http://superuser.stackexchange.com should be a better place for this question – Steve B Oct 18 '11 at 07:46
-
Why don't you put the details in the 'Tools -> Internet Options' once and just forget it? – Neeta Oct 18 '11 at 07:47
-
@Neeta - I want to do it programmaticaly. – user952838 Oct 18 '11 at 07:58
-
Look at: http://stackoverflow.com/questions/197725/programmatically-set-browser-proxy-settings-in-c-sharp and http://stackoverflow.com/questions/3417685/programmatically-set-proxy-address-port-user-password-throught-windows-regist – Kangkan Oct 18 '11 at 08:08
-
@Kangkan - i have gone through that link but none of the solution given over ther works. – user952838 Oct 19 '11 at 14:29
1 Answers
0
You can set the registry entry like this
RegistryKey registry = Registry.CurrentUser.OpenSubKey("Software\\Microsoft\\Windows\\CurrentVersion\\Internet Settings", true);
registry.SetValue("ProxyEnable", 1);
registry.SetValue("ProxyServer", "user:password@127.0.0.1:8080");
This works with IE only and Firefox does not work with this.

Neeta
- 163
- 8