Writing Binary Information to a File - CSharp File IO

CSharp examples for File IO:Binary File

Description

Writing Binary Information to a File

Demo Code

using System;/* ww  w  .  j a v a2 s.co  m*/
using System.IO;
class MyStream
{
   public static void Main(String[] args)
   {
         FileStream myFile = new FileStream("main.css", FileMode.CreateNew);
         BinaryWriter bwFile = new BinaryWriter(myFile);
         // Write data to Test.data.
         for (int i = 0; i < 100 ; i++)
         {
            bwFile.Write(i );
         }
         bwFile.Close();
         myFile.Close();
   }
}

Related Tutorials