• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1455
  • Last Modified:

Configure IE Proxy Exceptions Programmatically

We have a wireless aircard that is used by many of our laptop users. When users connect to Wireless via this card, their IE proxy bypass exceptions are removed. I would like to create a tool in C# that users can run to restore these exceptions when the laptops connect to the internal network, and access our internal web apps.
0
jcjans
Asked:
jcjans
1 Solution
 
monarch_ilhanCommented:

  private void btnSaveOverride_Click(object sender, EventArgs e)
      {
          RegistryKey proxyKey = Registry.CurrentUser.OpenSubKey(@"Software\Microsoft\Windows\CurrentVersion\Internet Settings", false);
 
          object objOverRide= proxyKey.GetValue("ProxyOverride");
          string txtOverride=objOverRide==null?"":objOverRide.ToString();
          StreamWriter sw = new StreamWriter(@"C:\proxyOverride.txt", false);
          sw.WriteLine(txtOverride);
          sw.Close();
          proxyKey.Close();
 
      }
 
 private void btnRestoreOverride_Click(object sender, EventArgs e)
      {
          
          RegistryKey proxyKey = Registry.CurrentUser.OpenSubKey(@"Software\Microsoft\Windows\CurrentVersion\Internet Settings", true);
          StreamReader sr = new StreamReader(@"C:\proxyOverride.txt");          
          string txtOverride = sr.ReadLine();
          proxyKey.SetValue("ProxyOverride", txtOverride==null?"":txtOverride);
          proxyKey.Close();
          sr.Close();
 
      }

Open in new window

0
 
jcjansAuthor Commented:
Perfect -exactly what I was looking for. Thanks!!
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now