IPAddress Constructor (Int64)

Microsoft Silverlight will reach end of support after October 2021. Learn more.

Initializes a new instance of the IPAddress class with the address specified as an Int64.

Namespace:  System.Net
Assembly:  System.Net (in System.Net.dll)

Syntax

'Declaration
Public Sub New ( _
    newAddress As Long _
)
public IPAddress(
    long newAddress
)

Parameters

  • newAddress
    Type: System.Int64
    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".

Exceptions

Exception Condition
ArgumentOutOfRangeException

The newAddress parameter is out of range for an IPv4 address.

Remarks

The IPAddress instance is created with the IP address set to newAddress.

The IPAddress(Int64) constructor can only be used to construct an IPv4 address, since the size of the Int64 is not large enough for an IPv6 address.

The Int64 value is assumed to be in network byte order.

Version Information

Silverlight

Supported in: 5, 4, 3

Silverlight for Windows Phone

Supported in: Windows Phone OS 7.1

Platforms

For a list of the operating systems and browsers that are supported by Silverlight, see Supported Operating Systems and Browsers.