C# IPAddress NetworkToHostOrder(Int16)

Description

IPAddress NetworkToHostOrder(Int16) Converts a short value from network byte order to host byte order.

Syntax

IPAddress.NetworkToHostOrder(Int16) has the following syntax.


public static short NetworkToHostOrder(
  short network
)

Parameters

IPAddress.NetworkToHostOrder(Int16) has the following parameters.

  • network - The number to convert, expressed in network byte order.

Returns

IPAddress.NetworkToHostOrder(Int16) method returns A short value, expressed in host byte order.

Example

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


using System;/*from w w w  . j  av  a 2  s.co m*/
using System.Net;
using System.Net.Sockets;

public class Example
{
    public static void Main()
    {

        short hostByte;
        hostByte = IPAddress.NetworkToHostOrder((short)100);
        Console.WriteLine(hostByte);
    }

}

The code above generates the following result.





















Home »
  C# Tutorial »
    System.Net »




Cookie
Dns
IPAddress
IPEndPoint
IPHostEntry
WebClient