views:

95

answers:

1

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

+1  A: 

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;
            }
Sergio
thank you for posting your solution!
arturh

related questions