Walter.Net.Networking
IsInSameSubnet(IPAddress,IPAddress) Method
Walter.Net.Networking Assembly > Walter.Net.Networking Namespace > NetworkExtensionMethods Class > IsInSameSubnet Method : IsInSameSubnet(IPAddress,IPAddress) Method
Firs address
Second address
Test to see if the IP address is in the same subnet as the source IP address
Syntax
public static bool IsInSameSubnet( 
   IPAddress address1,
   IPAddress address2
)

Parameters

address1
Firs address
address2
Second address
Exceptions
ExceptionDescription
Either IP address was null.
Lengths of IP address and subnet mask do not match if IP subnet does not belongs to IP address.
Requirements

Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

See Also

Reference

NetworkExtensionMethods Class
NetworkExtensionMethods Members
Overload List