.NET Namespace: System.Net.IP
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.
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.
Member | Description |
---|---|
ParseIPv4 | Parses an IPv4 address string. |
ParseIPv6 | Parses an IPv6 address string. |
ParseAddress | Parses an IP address string (IPv4 or IPv6). |
Parses a string representing an IPv4 address.
static internal IPAddress ParseIPv4(string ipString)
The string containing the IPv4 address to parse.
An IPAddress
object representing the parsed IPv4 address.
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.
Parses a string representing an IPv6 address.
static internal IPAddress ParseIPv6(string ipString)
The string containing the IPv6 address to parse.
An IPAddress
object representing the parsed IPv6 address.
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.
Parses a string representing either an IPv4 or IPv6 address.
static internal IPAddress ParseAddress(string ipString)
The string containing the IP address (IPv4 or IPv6) to parse.
An IPAddress
object representing the parsed IP address.
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.