Ejemplo n.º 1
0
 public static bool IsInSameAddressFamily(IPAddress firstAddress, IPAddress secondAddress)
 {
     return((RuntimePlatformUtils.IPAddressIsValidIPv4(firstAddress.ToString()) && RuntimePlatformUtils.IPAddressIsValidIPv4(secondAddress.ToString())) ||
            (RuntimePlatformUtils.IPAddressIsValidIPv6(firstAddress.ToString()) && RuntimePlatformUtils.IPAddressIsValidIPv6(secondAddress.ToString())));
 }