Use BitConvert to convert String, Boolean and Int32 : Bit Convert : File Stream C# Source Code


Custom Search

C# Source Code » File Stream » Bit Convert »

 

Use BitConvert to convert String, Boolean and Int32









    


using System;
using System.IO;

class Test {
    public static void Main() {
        byte[] b = BitConverter.GetBytes(true);
        Console.WriteLine(BitConverter.ToString(b));
        Console.WriteLine(BitConverter.ToBoolean(b,0));
        b = BitConverter.GetBytes(3678);
        Console.WriteLine(BitConverter.ToString(b));

        // Convert a byte array to an int and display.
        Console.WriteLine(BitConverter.ToInt32(b,0));
    }
}

           
       
    
   
  
   







HTML code for linking to this page:

Follow Navioo On Twitter

C# Source Code

 Navioo File Stream
» Bit Convert