C# IPAddress NetworkToHostOrder(Int32)

Description

IPAddress NetworkToHostOrder(Int32) Converts an integer value from network byte order to host byte order.

Syntax

IPAddress.NetworkToHostOrder(Int32) has the following syntax.


public static int NetworkToHostOrder(
  int network
)

Parameters

IPAddress.NetworkToHostOrder(Int32) has the following parameters.

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

Returns

IPAddress.NetworkToHostOrder(Int32) method returns An integer value, expressed in host byte order.

Example

The following example uses the NetworkToHostOrder method to convert an integer value from network byte order to host byte order.


using System;//from   w  ww . jav  a 2  s  . c om
using System.Net;
using System.Net.Sockets;

public class Example
{
   public static void Main()
   {
      int hostByte;
      hostByte = IPAddress.NetworkToHostOrder(100);
      Console.WriteLine(hostByte);
   }
}

The code above generates the following result.





















Home »
  C# Tutorial »
    System.Net »




Cookie
Dns
IPAddress
IPEndPoint
IPHostEntry
WebClient