httpclient代理不工作C#

httpclient代理不工作C#,c#,httpclient,.net-4.5,C#,Httpclient,.net 4.5,我正在尝试将代理与httpclient请求一起使用 string proxystring = "http://xx.xxx.xxx.xxx:3128/"; HttpClientHandler handler2 = new HttpClientHandler(); handler2.Proxy = new WebProxy(proxystring, false); handler2.Us

我正在尝试将代理与httpclient请求一起使用

        string proxystring = "http://xx.xxx.xxx.xxx:3128/";                        
        HttpClientHandler handler2 = new HttpClientHandler();
        handler2.Proxy = new WebProxy(proxystring, false);
        handler2.UseProxy = true;
        HttpClient client2 = new HttpClient(handler2);
代理设置被忽略,且其不起作用。
有没有办法解决此问题?

如何确定代理设置被忽略?你的代码似乎适合我。当我在代理字符串中插入假代理时,应用程序仍然可以工作