[Csharp] using System; using System. collections. generic; using System. linq; using System. text; using System. IO; namespace text {class Program {static void Main (string [] args) {FileStream fs = new FileStream ("test.txt", FileMode. openOrCreate); BinaryWriter bw = new BinaryWriter (fs); bw. write (1); bw. write (2); bw. write (3); bw. close (); fs. close (); Console. readKey (); Console. writeLine (); FileStream fs2 = new FileStream ("test.txt", FileMode. open); BinaryReader br = new BinaryReader (fs2); int a = br. readInt32 (); int B = br. readInt32 (); int c = br. readInt32 (); Console. writeLine (a); Console. writeLine (B); Console. writeLine (c); br. close (); fs2.Close (); Console. readKey (); FileStream fs3 = new FileStream ("test2.txt", FileMode. create); StreamWriter sw = new StreamWriter (fs3); sw. writeLine ("test from watkins"); sw. writeLine ("235"); sw. writeLine (5); sw. writeLine ("hah"); sw. close (); fs3.Close (); Console. readKey (); Console. writeLine (); FileStream fs4 = new FileStream ("test2.txt", FileMode. open); StreamReader sr = new StreamReader (fs4); string s1 = sr. readLine (); string s2 = sr. readLine (); string s3 = sr. readLine (); string s4 = sr. readLine (); Console. writeLine (s1); Console. writeLine (s2); Console. writeLine (s3); Console. writeLine (s4); Console. readKey () ;}} using System; using System. collections. generic; using System. linq; using System. text; using System. IO; namespace text {class Program {static void Main (string [] args) {FileStream fs = new FileStream ("test.txt", FileMode. openOrCreate); BinaryWriter bw = new BinaryWriter (fs); bw. write (1); bw. write (2); bw. write (3); bw. close (); fs. close (); Console. readKey (); Console. writeLine (); FileStream fs2 = new FileStream ("test.txt", FileMode. open); BinaryReader br = new BinaryReader (fs2); int a = br. readInt32 (); int B = br. readInt32 (); int c = br. readInt32 (); Console. writeLine (a); Console. writeLine (B); Console. writeLine (c); br. close (); fs2.Close (); Console. readKey (); FileStream fs3 = new FileStream ("test2.txt", FileMode. create); StreamWriter sw = new StreamWriter (fs3); sw. writeLine ("test from watkins"); sw. writeLine ("235"); sw. writeLine (5); sw. writeLine ("hah"); sw. close (); fs3.Close (); Console. readKey (); Console. writeLine (); FileStream fs4 = new FileStream ("test2.txt", FileMode. open); StreamReader sr = new StreamReader (fs4); string s1 = sr. readLine (); string s2 = sr. readLine (); string s3 = sr. readLine (); string s4 = sr. readLine (); Console. writeLine (s1); Console. writeLine (s2); Console. writeLine (s3); Console. writeLine (s4); Console. readKey ();}}}