Quantcast
Channel: Internet Explorer Web Development forum
Viewing all articles
Browse latest Browse all 3527

To update the exception list (bypass proxy list) of proxy settings in IE through C#

$
0
0

Hi,

We are developing a desktop application using WPF and C#, as part of our functional requirements, we have to update the exception list (bypass addresses) to view local addresses on browser.

The code has been taken from this source: https://www.codeproject.com/Tips/1223511/Csharp-Programming-Enable-Disable-Proxy-IP

 Registry.SetValue("HKEY_CURRENT_USER\\Software\\Microsoft\\Windows\\CurrentVersion\\Internet Settings", "ProxyOverride", _proxyByPass);
// Forcing the OS to refresh the IE settings to reflect new proxy settings.
 InternetSetOption(IntPtr.Zero, INTERNET_OPTION_SETTINGS_CHANGED, IntPtr.Zero, 0);
InternetSetOption(IntPtr.Zero, INTERNET_OPTION_REFRESH, IntPtr.Zero, 0)

This code adds the IP address into bypass list  However, its not actually reflecting on browser side when we hit its IP into tab (IE, Chrome)

When we manually press OK on proxy settings once IP address is inserted through code (Connection-> LAN Settings-> Advanced -> Exception list), it works fine

To reflect the altered changes into IE, two functions are used of (wininet.dll) that refresh the IE setting ( I believe), but not working as expected

System  Environment:

  • OS: Win 7, 10
  • IE: 11.0
  • .Net Framework: v4.5.2

Can anyone guide on this  please?  How to add ip addresses permanently into IE ?

 


Viewing all articles
Browse latest Browse all 3527

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>