简体   繁体   English

如何在IE中以编程方式设置代理用户名和密码?

[英]How to programmatically set the proxy username and password in IE?

How can I programmatically set the proxy username and password in IE using C#. 如何使用C#在IE中以编程方式设置代理用户名和密码。 The problem is it asks me everytime, I open an IE instance and start browsing a page. 问题是它每次都问我,我打开一个IE实例并开始浏览页面。

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. 这仅适用于IE,而Firefox不适用于此功能。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM