public static int AsInt( [NotNull] this IPAddress thisAddr ) { if( thisAddr == null ) throw new ArgumentNullException( "thisAddr" ); return IPAddress.HostToNetworkOrder( BitConverter.ToInt32( thisAddr.GetAddressBytes(), 0 ) ); }