How to get proxy definitions from within an activeX
Question
Ok, so here is the scenario:
I have an activeX that uploads files using HttpWebRequest class. My problem is that I have to specify the network credentials in order to get the activeX to work properly behind a proxy server.
Here is the code:
HttpWebRequest req = (HttpWebRequest)WebRequest.Create(m_url);
req.Proxy = new WebProxy("http://myProxyServer:8080");
req.Proxy.Credentials = new NetworkCredential("user", "password", "domain");
How can i get this information from iExplorer with no (or minimal) user interface?
Thank You :)
Solution
I managed to do it ;)
private static WebProxy QueryIEProxySettings(string strFileURL)
{
HttpWebRequest WebReqt = (HttpWebRequest)HttpWebRequest.Create(strFileURL);
WebProxy WP = new WebProxy(WebReqt.Proxy.GetProxy(new Uri(strFileURL)));
WP.Credentials = CredentialCache.DefaultCredentials;
return WP;
}
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow