Results 1 to 2 of 2

Thread: webbrowser - show error if page can't be opened

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Nov 2011
    Posts
    17

    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...?

  2. #2
    Junior Member
    Join Date
    Jan 2012
    Posts
    25

    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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width