Public Function isInternetConnected(Optional pUrl As String = "http://www.google.com") As Boolean Try Using client = New WebClient() Using stream = client.OpenRead(pUrl) Return True End Using End Using Return IsConnectedToInternet(pUrl) Catch ex As Exception Return IsConnectedToInternet(pUrl) End Try End Function
'reference to System.Net and System.Net.NetworkInformation is required! Function IsInternetConnected() AS Boolean Return New Ping().Send("www.google.com").Status = IPStatus.Success ENd Function
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)