Can anyone kindly let me know how to put codes in my program to check if the network card is currently connects to nowhere (in nortification area, the small computer icon is crossed in red). Many thanks!
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim bNetworkCablePlugged As Boolean = True
Catch ex As Exception
If Err.Number = 5 Then
bNetworkCablePlugged = False
If the control goes inside the catch block,then the network cable is unplugged..Note that the error number is 5 only...for netwrok...
Private Sub MyApplication_NetworkAvailabilityChanged(ByVal sender As Object, ByVal e As Microsoft.VisualBasic.Devices.NetworkAvailableEventArgs) Handles Me.NetworkAvailabilityChanged
If e.IsNetworkAvailable Then
MsgBox("Yippiiee we r online")