0
namespace BinaryFileIO
{

    class Program
    {







        static void Main()
        {

            FileStream BinFile = new FileStream("BinFile.bin", FileMode.Create, FileAccess.Write);
            BinaryFormatter bformatter1 = new BinaryFormatter();
         //right to file
            Random rng = new Random();
             for (int i = 0; i < 10; i++)

                {
                   // how  do i put to the file and than read from it to console????


                }

             BinFile.Close();
                 //reads to console,but not from file
             FileStream BinFile2 = new FileStream("BinFile.bin", FileMode.Open, FileAccess.Read);
             for (int i = 0; i < 10; i++)
             {

                 Console.WriteLine(rng.Next(1, 101));

             }


            Console.ReadKey();



        }
    }
}

Edited by PulsarScript

3
Contributors
2
Replies
26
Views
2 Years
Discussion Span
Last Post by yesi_1
This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.