Website Checker If the address is Online or Offline

This tutorial is basically check the domain or the web address if it is online or offline. We are going to use the certain website to handle web request and link the textbox. So, make sure you are connected to the internet to work the program properly.

Open your Visual Basic .NET Application.

Step 1:
Create a New Project, go to File Menu and navigate to New > Project then name it WebsiteChecker (see Image below).



Step 2:
Next, Add a New Form by navigating in Project Menu and Click Add Windows Form. You can change the name of your form if you want (optional).




Step 3:
Add 1 Button and 1 TextBox (Please refer to the image below).



TextBox Property
Name: TextBox1

Button Property
Name: btnCheck

Code:


Imports System.Net
Imports System.IO

Public Class frmWebChecker
    Private Sub btnCheck_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnCheck.Click
        Try
            Dim r As HttpWebRequest = HttpWebRequest.Create("http://www.downforeveryoneorjustme.com/" & TextBox1.Text)
            Dim re As HttpWebResponse = r.GetResponse()
            Dim src As String = New StreamReader(re.GetResponseStream()).ReadToEnd()
            If (src.Contains("It's just you.")) Then
                MsgBox(TextBox1.Text & " is Online", MsgBoxStyle.Information, "ONLINE")
            Else
                MsgBox(TextBox1.Text & " is Offline", MsgBoxStyle.Information, "OFFLINE")
            End If
        Catch ex As WebException
            MsgBox("It's probably your connection... Unable to connect to downforeveryoneorjustme.com")
        End Try
    End Sub
End Class
Final Output:


Website Checker If the address is Online or Offline Website Checker If the address is Online or Offline Reviewed by code-dev on 11:03 PM Rating: 5

No comments:

Powered by Blogger.