Returns number of subnet bits in the mask.
Subnet bits are bits set to value 0 in the subnet mask.
Namespace: SnmpSharpNetAssembly: SnmpSharpNet (in SnmpSharpNet.dll) Version: 0.9.1.0 (0.9.1)
Syntax
| C# |
|---|
public int GetMaskBits() |
| Visual Basic |
|---|
Public Function GetMaskBits As Integer |
| Visual C++ |
|---|
public:
int GetMaskBits() |
Return Value
Set bits in the subnet mask or 0 if invalid subnet mask
Examples
CopyC#
IpAddress mask = new IpAddress("255.255.255.0");
Console.WriteLine("Mask bits: {0}", mask.GetMaskBits()); # Print "Mask bits: 24"
mask.Set("255.255.255.128");
Console.WriteLine("Mask bits: {0}", mask.GetMaskBits()); # Print "Mask bits: 25"
See Also