You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Here is a code that does NOT work, but explains what I want to do. var ipBegin = IPAddress.Parse("192.168.0.0"); var rangeA = new IPAddressRange(ipBegin, maskLength: 24); rangeA.ToCidrBit() // is 24
I'm looking for a way to get the CIDR bit (or maskLength, as this project calls it) from the existing IPAddressRange object. (none exist)
And the closest I've found is by, see below, var ipSubnet = IPAddress.Parse("255.255.255.0"); IPAddressRange.SubnetMaskLength(ipSubnet); // is 24
However, this will not help me as I can't find a way to get the subnet mask from the existing IPAddressRange object.
Is there a way to do this?
The text was updated successfully, but these errors were encountered:
The GetPrefixLength() method of the IPAddressRange object might work for that purpose, like the ToCidrBit() method in your fictitious sample programs. Could you try it out?
Hi,
Here is a code that does NOT work, but explains what I want to do.
var ipBegin = IPAddress.Parse("192.168.0.0");
var rangeA = new IPAddressRange(ipBegin, maskLength: 24);
rangeA.ToCidrBit() // is 24
I'm looking for a way to get the CIDR bit (or maskLength, as this project calls it) from the existing IPAddressRange object. (none exist)
And the closest I've found is by, see below,
var ipSubnet = IPAddress.Parse("255.255.255.0");
IPAddressRange.SubnetMaskLength(ipSubnet); // is 24
However, this will not help me as I can't find a way to get the subnet mask from the existing IPAddressRange object.
Is there a way to do this?
The text was updated successfully, but these errors were encountered: