IPAddressParser Class

.NET Namespace: System.Net.IP

Class IPAddressParser

Provides functionality for parsing IP addresses from strings. This class is an internal helper class and is not intended for direct use by application developers. However, understanding its role can be beneficial for comprehending how IP address parsing is handled within the .NET Framework.

Remarks

The IPAddressParser class is responsible for taking string representations of IP addresses (both IPv4 and IPv6) and converting them into their respective IPAddress objects. It handles various formats and potential errors during the parsing process, ensuring that valid IP addresses are correctly interpreted.

Summary of Members

Member Description
ParseIPv4 Parses an IPv4 address string.
ParseIPv6 Parses an IPv6 address string.
ParseAddress Parses an IP address string (IPv4 or IPv6).

ParseIPv4 Method

Parses a string representing an IPv4 address.

static internal IPAddress ParseIPv4(string ipString)

Parameters

Return Value

An IPAddress object representing the parsed IPv4 address.

Remarks

This method is an internal helper used by the IPAddress class to convert a string into an IPv4 address. It is not meant to be called directly.

ParseIPv6 Method

Parses a string representing an IPv6 address.

static internal IPAddress ParseIPv6(string ipString)

Parameters

Return Value

An IPAddress object representing the parsed IPv6 address.

Remarks

This method is an internal helper used by the IPAddress class to convert a string into an IPv6 address. It handles the complex formatting rules of IPv6 addresses.

ParseAddress Method

Parses a string representing either an IPv4 or IPv6 address.

static internal IPAddress ParseAddress(string ipString)

Parameters

Return Value

An IPAddress object representing the parsed IP address.

Remarks

This is the primary parsing method used internally. It detects whether the input string is an IPv4 or IPv6 address and calls the appropriate internal parsing logic.

See Also