## Definition

Converts a value from host byte order to network byte order.

 HostToNetworkOrder(Int16) Converts a short value from host byte order to network byte order. HostToNetworkOrder(Int32) Converts an integer value from host byte order to network byte order. HostToNetworkOrder(Int64) Converts a long value from host byte order to network byte order.

## HostToNetworkOrder(Int16)

Converts a short value from host byte order to network byte order.

``````public:
static short HostToNetworkOrder(short host);``````
``public static short HostToNetworkOrder (short host);``
``static member HostToNetworkOrder : int16 -> int16``
``Public Shared Function HostToNetworkOrder (host As Short) As Short``

#### Parameters

host
Int16

The number to convert, expressed in host byte order.

#### Returns

Int16

A short value, expressed in network byte order.

### Remarks

Different computers use different conventions for ordering the bytes within multibyte integer values. Some computers put the most significant byte first (known as big-endian order) and others put the least-significant byte first (known as little-endian order). To work with computers that use different byte ordering, all integer values that are sent over the network are sent in network byte order which has the most significant byte first.

The HostToNetworkOrder method converts multibyte integer values that are stored on the host system from the byte order used by the host to the byte order used by the network.

## HostToNetworkOrder(Int32)

Converts an integer value from host byte order to network byte order.

``````public:
static int HostToNetworkOrder(int host);``````
``public static int HostToNetworkOrder (int host);``
``static member HostToNetworkOrder : int -> int``
``Public Shared Function HostToNetworkOrder (host As Integer) As Integer``

#### Parameters

host
Int32

The number to convert, expressed in host byte order.

#### Returns

Int32

An integer value, expressed in network byte order.

### Remarks

Different computers use different conventions for ordering the bytes within multibyte integer values. Some computers put the most significant byte first (known as big-endian order) and others put the least-significant byte first (known as little-endian order). To work with computers that use different byte ordering, all integer values that are sent over the network are sent in network byte order which has the most significant byte first.

The HostToNetworkOrder method converts multibyte integer values that are stored on the host system from the byte order used by the host to the byte order used by the network.

## HostToNetworkOrder(Int64)

Converts a long value from host byte order to network byte order.

``````public:
static long HostToNetworkOrder(long host);``````
``public static long HostToNetworkOrder (long host);``
``static member HostToNetworkOrder : int64 -> int64``
``Public Shared Function HostToNetworkOrder (host As Long) As Long``

#### Parameters

host
Int64

The number to convert, expressed in host byte order.

#### Returns

Int64

A long value, expressed in network byte order.

### Remarks

Different computers use different conventions for ordering the bytes within multibyte integer values. Some computers put the most significant byte first (known as big-endian order) and others put the least-significant byte first (known as little-endian order). To work with computers that use different byte ordering, all integer values that are sent over the network are sent in network byte order which has the most significant byte first.

The HostToNetworkOrder method converts multibyte integer values that are stored on the host system from the byte order used by the host to the byte order used by the network.