webbrowser - show error if page can't be opened
Hi,
I am making a checkprogram to check if a website is still online. I want the program to show a message when a website isn't online anymore. I am checking this with a timer en a webbrowser, if the browser can not reach the webpage, it should show a message.
But how do I do that or is it even possible...?:(
Re: webbrowser - show error if page can't be opened
you could try something like this
Code:
Public Sub CheckifSiteExists()
Dim HttpWReq As HttpWebRequest = _
CType(WebRequest.Create("http://www.google.com"), HttpWebRequest)
Try
HttpWReq.GetResponse()
MsgBox("The website does exist")
Catch
MsgBox("The website doesn't exist")
End Try
End Sub