CSharp examples for File IO:Binary File
Writing Binary Information to a File
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(); } }