Class IPNetwork
An IP network.
Inheritance
System.Object
IPNetwork
Namespace: FM.LiveSwitch
Assembly: FM.LiveSwitch.dll
Syntax
public class IPNetwork : object
Properties
Address
Gets the address.
Declaration
public string Address { get; }
Property Value
Type | Description |
---|---|
System.String |
Mask
Gets the mask.
Declaration
public string Mask { get; }
Property Value
Type | Description |
---|---|
System.String |
PrefixLength
Gets the prefix length.
Declaration
public int PrefixLength { get; }
Property Value
Type | Description |
---|---|
System.Int32 |
Methods
Matches(String)
Checks if an address exists in this network.
Declaration
public bool Matches(string address)
Parameters
Type | Name | Description |
---|---|---|
System.String | address | The address. |
Returns
Type | Description |
---|---|
System.Boolean |
|
Parse(String)
Parses a CIDR.
Declaration
public static IPNetwork Parse(string cidr)
Parameters
Type | Name | Description |
---|---|---|
System.String | cidr | The CIDR. |
Returns
Type | Description |
---|---|
IPNetwork | The IP network. |
ToString()
Returns a string that represents this instance.
Declaration
public override string ToString()
Returns
Type | Description |
---|---|
System.String | A string that represents this instance. |
TryParse(String, out IPNetwork)
Tries to parse a CIDR.
Declaration
public static bool TryParse(string cidr, out IPNetwork network)
Parameters
Type | Name | Description |
---|---|---|
System.String | cidr | The CIDR. |
IPNetwork | network | The IP network. |
Returns
Type | Description |
---|---|
System.Boolean |
|