Results 1 to 3 of 3

Thread: Determine if a website is online..

  1. #1

    Thread Starter
    Hyperactive Member MarkusJ_NZ's Avatar
    Join Date
    Jun 2001
    Posts
    375

    Determine if a website is online..

    Hi, Does anyone have any code that I can rip that checks to see if a website is online???

    Cheers
    MarkusJ

  2. #2
    Frenzied Member DevGrp's Avatar
    Join Date
    Nov 2001
    Location
    Charlotte, NC
    Posts
    1,256
    You can try to ping the website using the process class.
    Here is an example.

    VB Code:
    1. Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
    2.         Dim p As New Process()
    3.  
    4.         With p
    5.             .StartInfo.Arguments = "www.microsoft.com"
    6.             .StartInfo.WindowStyle = ProcessWindowStyle.Normal
    7.             .StartInfo.FileName = "ping"
    8.         End With
    9.  
    10.         p.Start()
    11.         p.WaitForExit()
    12.  
    13.         If (p.ExitCode = 1) Then 'if exit code is 0 then website is up
    14.             MessageBox.Show("Website down")
    15.         End If
    16.  
    17. End Sub
    Dont gain the world and lose your soul

  3. #3

    Thread Starter
    Hyperactive Member MarkusJ_NZ's Avatar
    Join Date
    Jun 2001
    Posts
    375
    Awesome, that's exactly what I am after
    Thanks
    MarkusJ

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