title: Enabling/disabling proxy app doesn't work properly with IE
body: <p>I have a really strange situation here: I've written an app that, among other things, switches connections' proxy from on to off and the other way round. It is done by changing the value in the registry:  </p>
  
  <pre><code>public void SetUpProxy(string proxy, bool enable)
  {
      RegistryKey key = Registry.CurrentUser.OpenSubKey("Software\\Microsoft\\Windows\\CurrentVersion\\Internet Settings", true);
      if (proxy != null)
          key.SetValue("ProxyServer", proxy);
      key.SetValue("ProxyEnable", enable ? 1 : 0);
      key.Close();
  }
  </code></pre>
  
  <p>When I request enabling the proxy in my app the first thing it does is to connect to ftp server, download a file, THEN enable the proxy (downloading wouldn't work with the proxy on). Everything works perfectly fine - until I launch Internet Explorer.<br>
  For example: if I start my app, let it enable the proxy, then let it disable the proxy - everything works fine. But if I enable the proxy, <strong>then launch IE</strong>, disable proxy and try enabling it again it doesn't work - the app cannot connect to the ftp server because somehow it uses proxy, even though the value in the registry is 0!<br>
  I hope I managed to explain it properly. My question is: why is it happening and how can I fix this?  </p>
  
  <p>Edit: I'm using WebClient class to download the file. I've found out that client.Proxy.GetProxy(myUri) returns the specified Uri when tha app runs fine, butwhen I open IE it changes to "<a href="http://theUriFromIE" rel="nofollow noreferrer">http://theUriFromIE</a>".</p>