stop loading web page

jackinc

New member
Joined
Sep 13, 2009
Messages
1
Programming Experience
Beginner
sorry... I'm not able to find my answer from threads...

I want close the loading of web page when it take more of tot seconds...
(if is possible with a Firefox or IE)
Code:

StrAdrress = "http://www.google.com"

Try
System.Diagnostics.Process.Start(strAddress.Trim)
Catch ex As Exception
MsgBox(ex.Message, MsgBoxStyle.Critical, "Error")
End Try

Threading.Thread.Sleep(50000)

So you can see I wait 50 seconds now....

Is it possible to convert this code in : if the page not load in 10 seconds, stop load,close the tab and open another tab with another address?

Thanks a lot
 
If you're loading the page in your own application with the WebBrowser control, then yes, use a Timer and the browsers Stop method if document isn't loaded within timeout. Automating other applications such as IE and FF, I doubt it.
 
Back
Top