Imports System
Imports System.IO
Imports System.Data
Public Class Form1
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim href As String
Dim links As New Collection
Dim NumPage As New ArrayList()
Dim cunter = 0
Wb.Navigate(TextBox2.Text & "&pp=200&sort=lastpost&order=desc")
Do Until Wb.ReadyState = WebBrowserReadyState.Complete
My.Application.DoEvents()
Loop
For Each link As HtmlElement In Wb.Document.Links
href = link.GetAttribute("href")
If href.Contains("&pp=200&sort=lastpost&order=desc&page") Then
Dim spliter() As String
spliter = href.Split("=")
NumPage.Insert(cunter, spliter(spliter.Length - 1))
cunter += 1
End If
Next
Dim str = (NumPage.Item(NumPage.Count - 1)) 'Microsoft.VisualBasic.Right(NumPage.Item(NumPage.Count - 1), 1)
Dim strArr() As String
strArr = str.Split("=")
Dim xx = (strArr(strArr.Length - 1))
For i As Integer = 1 To xx
Me.TextBox1.Text &= TextBox2.Text & "&pp=200&sort=lastpost&order=desc&page=" & i & vbNewLine
Next
End Sub
Public Function GetMaxValue(ByVal itemList As ArrayList)
Dim max As Integer = Nothing
For i As Integer = 0 To (itemList.Count - 1)
If i = 0 Then
max = itemList(i)
Else
If itemList(i) > max Then max = itemList(i)
End If
Next
GetMaxValue = max
End Function
End Class