Reputation: 7419
Is it possible to detect which proxy is active which is dead? using c# and a combo box containing list of proxies with port number is there any way we take every proxy one by one and determine as if it was dead or active?
Microsoft.Win32.RegistryKey registry = Microsoft.Win32.Registry.CurrentUser.OpenSubKey("Software\\Microsoft\\Windows\\CurrentVersion\\Internet Settings", true);
registry.SetValue("ProxyEnable", 1);
registry.SetValue("ProxyServer", comboBox1.Text)
;
Upvotes: 1
Views: 282
Reputation: 3731
I would try this: http://msdn.microsoft.com/en-us/library/system.net.httpwebrequest.aspx with sites as google and facebook [They will almost never fail xD] so if you get timeouts or null/wrong/unexpected data [Verify this with an HTML parser as this or this], you know the proxy is down/not working, also you can switch the proxy of your HttpWebRequest Instance and re-issue the command. hope it helps ;)
Upvotes: 2