I have this method:
public static void testConnection()
{
if (System.Net.NetworkInformation.NetworkInterface.GetIsNetworkAvailable())
{
System.Windows.MessageBox.Show("This computer is connected to the internet");
}
else
{
System.Windows.MessageBox.Show("This computer is not connected to the internet");
}
}
I suppose it would tell me whether the connection is available or not but it always return true (and print the 1st message) even when I'm sure there is no connection. What I'm doing wrong?
P.S.: I'm still learning C#.