Namespace: System.Net
IPAddress
Provides an Internet Protocol (IP) address.
Properties (3)
long ScopeId
Gets or sets the IPv6 address scope identifier.
Value: A long integer that specifies the scope of the address.
long Address
An Internet Protocol (IP) address.
Value: The long value of the IP address.
AddressFamily AddressFamily
Gets the address family of the IP address.
Value: Returns InterNetwork for IPv4 or InterNetworkV6 for IPv6.
Methods (4)
IPAddress(Int64)Constructor
Initializes a new instance of the IPAddress class with the address specified as an Int64.
| Parameter | Description |
|---|---|
| newAddress | The long value of the IP address. For example, the value 0x2414188f in big-endian format would be the IP address "143.24.20.36". |
bool TryParse(String,Net.IPAddress@)
Determines whether a string is a valid IP address.
| Parameter | Description |
|---|---|
| ipString | The string to validate. |
| address | The IPAddress version of the string. |
Returns: true if ipString was able to be parsed as an IP address; otherwise, false.
IPAddress Parse(String)
Converts an IP address string to an IPAddress instance.
| Parameter | Description |
|---|---|
| ipString | A string that contains an IP address in dotted-quad notation for IPv4 and in colon-hexadecimal notation for IPv6. |
Returns: An IPAddress instance.
byte[] GetAddressBytes
Provides a copy of the IPAddress as an array of bytes.
Returns: A Byte array.
Fields & Constants (3)
IPAddress Any
Provides an IP address that indicates that the server must listen for client activity on all network interfaces. This field is read-only.
IPAddress Loopback
Provides the IP loopback address. This field is read-only.
IPAddress Broadcast
Provides the IP broadcast address. This field is read-only.