I know there are many ways of doing it, I've read the SO posts.
I do not want to access a website, or externally if there is internet.
Is there a way to check internet status by checking the network card? In other words, when the laptop shows internet bars etc or computer itself shows "connected".
This method causes my code to be stuck:
private bool checkInternetStatus()
{
try
{
using (var client = new WebClient())
using (client.OpenRead("http://google.com/generate_204"))
online = true;
// Print("Connection estabished");
return true;
}
catch
{
online = false;
Print("No internet connection");
return false;
}
}