Convert a short value from network byte order to host byte order in CSharp
Description
The following code shows how to convert a short value from network byte order to host byte order.
Example
using System;/* w w w .j ava 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.