【问题标题】:change proxy instantly C#立即更改代理 C#
【发布时间】:2018-10-02 20:22:08
【问题描述】:

我有一个问题,我想每次可以更改我的浏览器的代理,但是过了一会儿它才改变,或者我检查一下互联网选项中的 ip 是否被更改,这是代码

        reg_key = Registry.CurrentUser.OpenSubKey("SoftWare\\Microsoft\\Windows\\CurrentVersion\\Internet Settings", true);
        string proxy = txtIp.Text + ":" + txtPort.Text;
        reg_key.SetValue("ProxyEnable", 1);
        reg_key.SetValue("ProxyServer", proxy);
        MessageBox.Show("IP cambiada, ", proxy);

        cronometro.Start();
        timer1.Start();
        label5.Text = (100 - cronometro.Elapsed.Seconds).ToString();
    }

现在,我怎样才能让它立即改变?

【问题讨论】:

    标签: c# selenium proxy


    【解决方案1】:

    使用 Selenium 时,您可以(并且应该)在创建 WebDriver 时使用创建 WebDriver 时使用的 InternetExplorerOptionsFirefoxOptionsChromeOptions 对象上的 Proxy 属性设置代理信息。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2018-06-04
      • 1970-01-01
      • 1970-01-01
      • 2018-10-12
      • 1970-01-01
      • 2023-04-04
      • 1970-01-01
      • 2015-02-21
      相关资源
      最近更新 更多