Check if the Computer is Connected to a Network using VB.NET 2005 and Higher

How to check if a computer is connected to a network or not.

‘Check if the computer is connected to the network. 
MsgBox(My.Computer.Network.IsAvailable)

One thought on “Check if the Computer is Connected to a Network using VB.NET 2005 and Higher

  1. Arun

    Dim networkAvailable As Boolean

    networkAvailable = My.Computer.Network.IsAvailable

    If networkAvailable = True Then

    MsgBox(“The network is available”)

    ElseIf networkAvailable = False Then

    MsgBox(“The network is unavailable”)

    End If

    Reply

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.