如何从activeX中获取代理定义

时间:2022-03-01 15:48:42

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.

我有一个使用HttpWebRequest类上传文件的activeX。我的问题是我必须指定网络凭据才能使activeX在代理服务器后面正常工作。

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?

如何从没有(或最小)用户界面的iExplorer获取此信息?

Thank You :)

谢谢 :)

1 个解决方案

#1


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

#1


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