Quantcast
Channel: VBForums - Visual Basic .NET
Viewing all articles
Browse latest Browse all 27513

VS 2010 For loop not working

$
0
0
Hey Guys,

I can't seem to see the problem here, i have a button when pressed it's supposed to do a for loop but the loope doesn't even start.

Code:

        '// AUTO LOAD PAGES
        For i = 200 To 50 Step 200
            MessageBox.Show("START LOOPING!")
            WebBrowser.Navigate("http://site.com/?start=" & i.ToString & "&flimit=200")

            '// CHECK BROWSER STATE
            'If WebBrowser.ReadyState <> WebBrowserReadyState.Complete Then
            Dim html As String = WebBrowser.DocumentText
            Dim pattern As String = "(?<=<td class=""field_domain""><a href="".+"" target=""_blank"" rel=""nofollow"" title="".+"">).+(?=</a></td>)"
            Dim rx As New Regex(pattern, RegexOptions.IgnoreCase Or RegexOptions.Compiled)

            '// LOOP THE MATCHES OUT
            Dim mc As MatchCollection = Regex.Matches(html, pattern)
            For Each m In mc
                listviewMain.Items.Add(m.ToString)
            Next
        Next

I put in: MessageBox.Show("START LOOPING!") to show me if any loops start but it doesn't popup, i'm stumped lol

any help would be great guys!

cheers

Graham

Viewing all articles
Browse latest Browse all 27513

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>