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).
TextBox Property
Name: TextBox1
Button Property
Name: btnCheck
Code:
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:
Final Output:Imports System.NetImports System.IOPublic Class frmWebCheckerPrivate Sub btnCheck_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnCheck.ClickTryDim 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.")) ThenMsgBox(TextBox1.Text & " is Online", MsgBoxStyle.Information, "ONLINE")ElseMsgBox(TextBox1.Text & " is Offline", MsgBoxStyle.Information, "OFFLINE")End IfCatch ex As WebExceptionMsgBox("It's probably your connection... Unable to connect to downforeveryoneorjustme.com")End TryEnd SubEnd Class
Website Checker If the address is Online or Offline
Reviewed by code-dev
on
11:03 PM
Rating:
No comments: