แก้ไข

แชร์ผ่าน


IPAddress.HostToNetworkOrder Method

Definition

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

Overloads

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)

Source:
IPAddress.cs
Source:
IPAddress.cs
Source:
IPAddress.cs

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

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.

See also

Applies to

HostToNetworkOrder(Int32)

Source:
IPAddress.cs
Source:
IPAddress.cs
Source:
IPAddress.cs

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

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.

See also

Applies to

HostToNetworkOrder(Int64)

Source:
IPAddress.cs
Source:
IPAddress.cs
Source:
IPAddress.cs

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

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.

See also

Applies to