IPNetwork(IPAddress, Int32) Constructor

Definition

Initializes a new instance of the IPNetwork class with the specified IPAddress and prefix length.

C#
public IPNetwork(System.Net.IPAddress baseAddress, int prefixLength);

Parameters

baseAddress
IPAddress

The IPAddress that represents the prefix of the network.

prefixLength
Int32

The length of the prefix in bits.

Exceptions

The specified baseAddress is null.

The specified prefixLength is smaller than 0 or longer than maximum length of prefixLength's AddressFamily.

The specified baseAddress has non-zero bits after the network prefix.

Applies to

Proizvod Verzije
.NET 8, 9, 10