65.9K
CodeProject is changing. Read more.
Home

Checking Internet Is Connected Or Not From .NET

starIconstarIconstarIconstarIcon
emptyStarIcon
starIcon

4.53/5 (9 votes)

May 26, 2011

CPOL
viewsIcon

11071

Dim value As Boolean = My.Computer.Network.IsAvailable can be used in a situation where the only network a system will be connected to is the Internet.Dim value As Boolean = My.Computer.Network.Ping(hostNameOrAddress ,timeout) hostNameOrAddress can be any valid website -...

Dim value As Boolean = My.Computer.Network.IsAvailable
can be used in a situation where the only network a system will be connected to is the Internet.
Dim value As Boolean = My.Computer.Network.Ping(hostNameOrAddress ,timeout) 
hostNameOrAddress can be any valid website - "www.google.com" timeout (Int32). Time threshold in milliseconds for contacting the destination. Default is 500.