kshadow22

Check Internet Availabitity Visual Basic 2008

Mar 30th, 2014
50
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. Imports Microsoft.Win32
  2. Public Class Check_Internet_Availibility
  3.     Dim internetStatus As Boolean
  4.     Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
  5.         If My.Computer.Network.IsAvailable Then
  6.             internetStatus = True
  7.         Else
  8.             internetStatus = False
  9.         End If
  10.         If internetStatus = True Then
  11.             Label2.Text = ("Active")
  12.             Label2.ForeColor = Color.Navy
  13.         Else
  14.             Label2.Text = ("Not Active")
  15.             Label2.ForeColor = Color.Maroon
  16.         End If
  17.     End Sub
  18.  
  19.     Private Sub Check_Internet_Availibility_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
  20.  
  21.     End Sub
  22. End Class
RAW Paste Data