Hi in a timer tick event a web broswer navigates to a web page but i want it to wait about 2 seconds so the page can load then continue with the code. I need to keep this all in one evrnt. Any ideas? Heres the code:
VB Code:
Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick web1.Navigate("http://www.22klmqu56.com/attacklist.php?c=1&uname=&page=" & page - 1 & "&jpage=" & page & "") '''''''***WAIT 2 SECONDS HERE***'''''''''' Dim ips As IPersistStreamInit Dim iptr As IntPtr Dim strm As UCOMIStream ips = DirectCast(web1.Document, IPersistStreamInit) iptr = Marshal.AllocHGlobal(2048) CreateStreamOnHGlobal(iptr, True, strm) ips.Save(strm, False) GetHGlobalFromStream(strm, iptr) Dim pattern As String = "(?<=\""\>)\w+(?=\<\/a\>\<\/TD\>\<TD\>)" Dim reg As New System.Text.RegularExpressions.Regex(pattern) Dim mcol As System.Text.regularexpressions.MatchCollection = reg.Matches(Marshal.PtrToStringAnsi(iptr)) For Each m As System.Text.RegularExpressions.Match In mcol ListBox1.Items.Add(m.Value) Next Timer1.Enabled = False End Sub




Reply With Quote