开发者

Detecting dead proxies

开发者 https://www.devze.com 2023-02-02 17:52 出处:网络
Is it possible to detect which proxy is ac开发者_如何学Gotive 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 de

Is it possible to detect which proxy is ac开发者_如何学Gotive 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)

;


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 ;)

0

精彩评论

暂无评论...
验证码 换一张
取 消