Run a FOR in Webbrowser C #

0

At the moment I am trying to develop a data capture application using C # WebBrowser . I can get the application to enter the page and enter the value and click search, however, I can not bind this function to the for loop so that it executes repeatedly! I would like to know how I do it. Here is an example of the code I have:

 private void BTN_OPEMIE_Click(object sender, EventArgs e)
    {
            navegar();

            insert();

            BtnPesq();
    }

    public void navegar()
    {
        wb_1.Navigate("http://www3.prefeitura.sp.gov.br/smt/pesqveic/Pesquisa.aspx");

        while (wb_1.ReadyState != WebBrowserReadyState.Complete)
        {
            Application.DoEvents();
        }

    }

    public void insert()
    {
        wb_1.Document.GetElementById("txtplaca").SetAttribute("value", "ASD7534");

        wb_1.Document.GetElementById("btnPesquisar").InvokeMember("Click");


    }

    public void BtnPesq()
    {
        wb_1.Document.GetElementById("btnPesquisar").InvokeMember("Click");

        while (wb_1.ReadyState != WebBrowserReadyState.Complete)
        {
            Application.DoEvents();

        }

    }

The for would be in this step of the code:

 private void BTN_OPEMIE_Click(object sender, EventArgs e)
{
     for(int i = 0; i < 10; i++)
      {
        navegar();

        insert();

        BtnPesq();
      }
}
    
asked by anonymous 04.05.2018 / 20:34

0 answers