Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Check Network Availablility VB.net

I'm writing an application that will be used in a mobile environment where network connectivity will be up/down regularly. How do I check to see that a specific network is available?

like image 480
Jeff Avatar asked Apr 22 '26 14:04

Jeff


2 Answers

Try NetworkInterface.GetIsNetworkAvailable:

Indicates whether any network connection is available.

A network connection is considered to be available if any network interface is marked "up" and is not a loopback or tunnel interface.

like image 110
Andrew Hare Avatar answered Apr 25 '26 20:04

Andrew Hare


To see if any network is available you can use the VB.NET My namespace:

My.Computer.Network.IsAvailable

which I would guess is an abstraction of the NetworkInterface property in Andrew's answer. To see if you can use an available network to get to a specific server, you can use

My.Computer.Network.Ping(host name or IP address, or a System.Uri)
like image 36
PhilPursglove Avatar answered Apr 25 '26 19:04

PhilPursglove



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!