C# code to Check IE Proxy Settings
private static void CheckIEProxySettings() { string strFileURL = " http://programmersvision.blogspot.in "; HttpWebRequest WebReqt = (HttpWebRequest)HttpWebRequest.Create(strFileURL); WebProxy WP = new WebProxy(WebReqt.Proxy.GetProxy(new Uri(strFileURL))); WP.Credentials = CredentialCache.DefaultCredentials; Console.WriteLine(WP.Address); // or use this method //CheckForProxy(new Uri(" http://http://programmersvision.blogspot.in ")); } private static void CheckForProxy(Uri resource) { WebProxy proxy = (WebProxy)WebProxy.GetDefaultProxy(); Uri proxyUri = proxy.GetProxy(resource); if (proxyUri == resource) { Console.WriteLine("There is no proxy for {0}", resource); } else { ...
Comments
Post a Comment