Work with My
namespace
We can use My.Computer.Network.IsAvailable in Visual Basic.NET to determine whether the network is connected. The definition of this property is:
153 154 155 156 157 158 159 160 161 162 163 164 165 166 |
'''********************************************************************** ''';IsAvailable ''' <summary> ''' Indicates whether or not the local machine is connected to an IP network. ''' </summary> ''' <value>True if connected, otherwise False</value> ''' <remarks></remarks> Public ReadOnly Property IsAvailable() As Boolean Get Return NetInfoAlias.NetworkInterface.GetIsNetworkAvailable() End Get End Property |
It leads to the approach in C#. Continue reading “Querying Network Status in .NET programming”