RuntimeHelperCheckSubnetMask - метод
Validates if the provided IP address matches the given subnet mask.
Пространство имён: Tessa.Platform.RuntimeСборка: Tessa (в Tessa.dll) Версия: 4.1.3+7e2b1422f9b8c7c41fbbc4b151a843bed05319ab
public static bool CheckSubnetMask(
string? subnetMask,
string? ipAddress,
bool mapToIPv4 = true
)
Public Shared Function CheckSubnetMask (
subnetMask As String,
ipAddress As String,
Optional mapToIPv4 As Boolean = true
) As Boolean
public:
static bool CheckSubnetMask(
String^ subnetMask,
String^ ipAddress,
bool mapToIPv4 = true
)
static member CheckSubnetMask :
subnetMask : string *
ipAddress : string *
?mapToIPv4 : bool
(* Defaults:
let _mapToIPv4 = defaultArg mapToIPv4 true
*)
-> bool
- subnetMask String
-
The subnet mask with prefix length (e.g., 255.255.255.0/24 or 2001:0db8::/32).
- ipAddress String
-
The IP address to be validated, in string format.
It can be either IPv4 or IPv6 address.
- mapToIPv4 Boolean (Optional)
-
Takes the last 4 bytes of an IPv6 address and converts it to an IPv4 address.
This does not restrict to address with the ::FFFF: prefix because other types of
addresses display the tail segments as IPv4 like Terado.
Boolean
Returns
if the IP address matches the subnet mask,
otherwise.
The subnet mask must include a prefix length (e.g., 255.255.255.0/24 or 2001:0db8::/32).
The method supports both IPv4 and IPv6 address families.
| ArgumentException |
Thrown when the subnet mask is invalid (e.g., prefix length is negative).
|
| ArgumentOutOfRangeException |
Thrown if the subnet mask length is not within the acceptable range for the address family
(e.g., a prefix length that exceeds the maximum allowed length for IPv4 or IPv6).
|
| FormatException |
Thrown when the subnet mask has invalid format (e.g., missing prefix length).
|
| InvalidOperationException |
Thrown when there is a mismatch between the address family of the IP address and subnet mask
(e.g., mixing IPv4 and IPv6 addresses if mapToIPv4 is ).
|