Exemplo n.º 1
0
 /// <summary>
 /// Returns whether or not the specified network adapter appears to be connected to a network device or not.
 /// </summary>
 /// <param name="networkAdapterInfo"></param>
 /// <returns></returns>
 public static bool IsNetworked(NetworkAdapterInfo networkAdapterInfo)
 {
     return(networkAdapterInfo.IpAddress != string.Empty &&
            networkAdapterInfo.IpAddress != "0.0.0.0" && // no IP at all ?
            networkAdapterInfo.IpAddress.StartsWith("127.") == false); // loopback ?
     //return IPAddress.IsLoopback( ip ) == false;
 }
Exemplo n.º 2
0
 /// <summary>
 /// Returns whether or not the wired network adapter appears to be connected to a network device or not.
 /// </summary>
 /// <returns></returns>
 public bool IsNetworked()
 {
     return(NetworkAdapterInfo.IsNetworked(this));
 }