Unable to query proxy “Automatically Detect Settings” on windows 7

后端 未结 2 601
孤独总比滥情好
孤独总比滥情好 2021-01-06 15:54

I am trying to capture proxy setting (\"Automatically Detect Settings\"). My code works on XP and Vista. But it is NOT working on Windows 7

Please see the details of

2条回答
  •  抹茶落季
    2021-01-06 16:34

    I have a C# code snippet where you can Check/Uncheck 'Automatically detect settings' check box of IE Connection Settings. You can find what you are looking for in this snippet.

        public bool IsIEAutoDetectProxy(bool set)
        {
            // Setting Proxy information for IE Settings.
            RegistryKey RegKey = Registry.CurrentUser.OpenSubKey(@"Software\\Microsoft\\Windows\\CurrentVersion\\Internet Settings\\Connections", true);
            byte[] defConnection = (byte[])RegKey.GetValue("DefaultConnectionSettings");
            if (defConnection[8] == Convert.ToByte(9))
               return true;
            else
               return false;
        } 
    

提交回复
热议问题