Public Shared Function CheckForInternetConnection() As Boolean Try Using client = New WebClient() Using stream = client.OpenRead("https://msdn.microsoft.com/") Return True End Using End Using Catch Return False End Try End Function