C# Selenium FireFox代理问题

C# Selenium FireFox代理问题,c#,selenium,selenium-webdriver,C#,Selenium,Selenium Webdriver,今天我在谷歌上搜索了很多关于这个问题的信息,我似乎找不到解决方案,我的代码看起来不错,但当我从列表框中选择一个随机代理时,它似乎没有被使用 代码: if (chkBoxProxies.Checked == true) { // Random proxy. Random random = new Random();

今天我在谷歌上搜索了很多关于这个问题的信息,我似乎找不到解决方案,我的代码看起来不错,但当我从列表框中选择一个随机代理时,它似乎没有被使用

代码:

                if (chkBoxProxies.Checked == true)
                {
                    // Random proxy.
                    Random random = new Random();
                    int c = listBoxMain.Items.Count;
                    int r = random.Next(c);
                    string s = listBoxMain.Items[r].ToString();
                    string[] spl = s.Split(':');
                    // Random proxy.

                    //Helpers.ReturnMessage(spl[0] + " > " + spl[1]);
                    _firefoxProfile.SetPreference("network.proxy.type", 1);
                    _firefoxProfile.SetPreference("network.proxy.http", spl[0]);
                    _firefoxProfile.SetPreference("network.proxy.http_port", spl[1]);
                }
我只是使用作为分隔符拆分代理,看起来一切都很好,但在加载站点的测试过程中:它仍然显示我的真实ip地址,如有任何帮助,将不胜感激