Sunday 30 November 2014

C# Fix Internet Explorer with wpad proxy

 public static void IEFix()
        {
            foreach (Process proc in Process.GetProcessesByName("iexplore.exe"))
            {
                proc.Kill();
            }
 
            RegistryKey startPageKey = Registry.CurrentUser.OpenSubKey(@"Software\Microsoft\Internet Explorer\Main", true);
            startPageKey.SetValue("Start Page", "http://");
            startPageKey.Close();
 
            RegistryKey startPageKey2 = Registry.CurrentUser.OpenSubKey(@"Software\Microsoft\Windows\CurrentVersion\Internet Settings", true);
            startPageKey2.SetValue("AutoConfigURL", "http:///wpad.dat");
            startPageKey2.Close();
            Tools.LaunchCommandLineApp("C:\\Program Files\\Internet Explorer\\iexplore.exe", "");
        }

No comments:

Post a Comment