C# how to increase the hit counter on webpage using for statement
<p>I'm new to programming, I'm trying to use the <code>webbrowser1</code> to increase the hit counter on a webpage, I can do this manually by clicking on the button to increase the hit counter, what I really wanted to do is make a <code>for(i=0; i &lt; 10 ; i++)</code> statement to refresh the page 10 times, but then I use the  statement like this it only increases the page by one, please see the code below, thanks in advance.</p>

<p>url: <a href="http://www.comptechdoc.org/independent/web/cgi/javamanual/javaihit.html" rel="nofollow">http://www.comptechdoc.org/independent/web/cgi/javamanual/javaihit.html</a></p>

<pre><code>namespace click
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        private void button1_Click(object sender, EventArgs e)
        {
            int i;

            for (i = 0; i &lt; 10; i++)
            {
                webBrowser1.Refresh();
                Application.DoEvents();
            }
        }
    }
}
</code></pre>

<p>edit:
thank you guys, for all your help and fast replys.</p>

<p>I've tryed the code from here: <a href="http://stackoverflow.com/questions/583897/c-how-to-wait-for-a-webpage-to-finish-loading-before-continuing">C# how to wait for a webpage to finish loading before continuing</a> and it seems to work well.</p>

<pre><code>private void button1_Click(object sender, EventArgs e)
{
    int i;

    for (i = 0; i &lt; 10; i++)
    {
        webBrowser1.Navigate(url);

        while (webBrowser1.ReadyState != WebBrowserReadyState.Complete)
            Application.DoEvents();
    }
}
</code></pre>
