Free download this tutorial link below
Imports System.Runtime.InteropServices
Public Class Form1
<DllImport("wininet.dll")> Private Shared Function InternetGetConnectedState(<System.Runtime.InteropServices.Out()> ByRef Description As Integer, ByVal ReservedValue As Integer) As Boolean
End Function
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim IntVAr As Integer
If InternetGetConnectedState(IntVAr, 0) = True Then
MessageBox.Show("Network has been connected")
End If
End Sub
End Class