Walter.Net.Networking
IsInLocalSubnet Method
Walter.Net.Networking Assembly > Walter.Net.Networking Namespace > NetworkExtensionMethods Class : IsInLocalSubnet Method
the IP address to test
Informs if the IP address is considered to be in a subnet mask of any of the server's assigned ip addresses (not reliable on IP6 when reverse PTR is not configured for V6
Syntax
public static bool IsInLocalSubnet( 
   IPAddress address
)

Parameters

address
the IP address to test

Return Value

True if in the same subnet (LAN)
Remarks
For IPv6, this may fail, since most IPv6 deployments do not register the reverse (PTR) record for an IPv6 address. So this method may return the string IPv6 literal as the fully-qualified domain (FQDN) host name in the HostName property and will never give the right answer.
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