C# IPAddress NetworkToHostOrder(Int64)

Description

IPAddress NetworkToHostOrder(Int64) Converts a long value from network byte order to host byte order.

Syntax

IPAddress.NetworkToHostOrder(Int64) has the following syntax.


public static long NetworkToHostOrder(
  long network
)

Parameters

IPAddress.NetworkToHostOrder(Int64) has the following parameters.

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

Returns

IPAddress.NetworkToHostOrder(Int64) method returns A long value, expressed in host byte order.

Example

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


using System;/*from  w ww  .  jav a2 s . c o m*/
using System.Net;
using System.Net.Sockets;

public class Example
{
   public static void Main()
   {
      long 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