Convert a byte array to an int and display : BitConverter : Development C# Examples


C# Examples » Development » BitConverter »

 

Convert a byte array to an int and display









    
using  System;
using  System.IO;
  
class  MainClass
{
        public  static  void  Main()  
        {
                byte[]  b  =  null;

                b  =  BitConverter.GetBytes(3678);
                Console.WriteLine(BitConverter.ToInt32(b,0));

        }
}
    
   
  
   



Output

3678


HTML code for linking to this page:

Follow Navioo On Twitter

C# Examples

 Navioo Development
» BitConverter