0

该程序应该在单击按钮时调用 start timer1,timer1 的长度为 17 秒。然后在 timer1 中应该启动 timer2,它是 8 秒长。由于某种原因,它不执行 timer2_tick 功能。

private void timer1_Tick(object sender, EventArgs e)
    {
        string[] ProxList = File.ReadAllLines("C:\\Prox.txt");

        string[] s = new string[4];            
        WinInetInterop.SetConnectionProxy(ProxList[p]);

        if (p > 3273)
            p = 0;

        s[0] = textBox1.Text;
        s[1] = textBox2.Text;
        s[2] = textBox3.Text;
        s[3] = textBox4.Text;

        try
        {
            webBrowser1.Navigate(s[txtBxNum]);

            timer2.Start();

            label1.Text = "Current Link: " + s[txtBxNum].ToString();
            label2.Text = "Current IP: " + ProxList[p].ToString();

            txtBxNum++;

            if (txtBxNum > 3)
                txtBxNum = 0;
        }
        catch { }

        p++;
    }

    private void timer2_Tick(object sender, EventArgs e)
    {
        webBrowser1.DocumentCompleted += webBrowser1_DocumentCompleted;
    }

    void webBrowser1_DocumentCompleted(object sender, WebBrowserDocumentCompletedEventArgs e)
    {
        try
        {
            webBrowser1.Document.GetElementById("skip_ad_button").InvokeMember("click");
        }
        catch { }
    }
4

0 回答 0