IPAddress Constructor (Byte[]) (System.Net)

Switch View :
ScriptFree
.NET Framework Class Library
IPAddress Constructor (Byte[])

Initializes a new instance of the IPAddress class with the address specified as a Byte array.

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

Visual Basic
Public Sub New ( _
	address As Byte() _
)
C#
public IPAddress(
	byte[] address
)
Visual C++
public:
IPAddress(
	array<unsigned char>^ address
)
F#
new : 
        address:byte[] -> IPAddress

Parameters

address
Type: System.Byte[]
The byte array value of the IP address.
Exceptions

Exception Condition
ArgumentNullException

address is null.

ArgumentException

address contains a bad IP address.

Remarks

The IPAddress is created with the Address property set to address.

If the length of address is 4, IPAddress(Byte[]) constructs an IPv4 address; otherwise, an IPv6 address with a scope of 0 is constructed.

The Byte array is assumed to be in network byte order with the most significant byte first in index position 0.

Version Information

.NET Framework

Supported in: 4, 3.5, 3.0, 2.0, 1.1

.NET Framework Client Profile

Supported in: 4, 3.5 SP1
Platforms

Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows XP SP2 x64 Edition, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.
See Also

Reference