Reading and Writing Files : StreamWriter : File Directory Stream C# Examples


C# Examples » File Directory Stream » StreamWriter »

 

Reading and Writing Files









    
using  System;
using  System.IO;

class  MainClass
{
        public  static  void  Main()
        {
                FileStream  f  =  new  FileStream("output.txt",  FileMode.Create);
                StreamWriter  s  =  new  StreamWriter(f);
                
                s.WriteLine("{0}  {1}",  "test",  55);
                s.Close();
                f.Close();
        }
}
    
   
  
   




HTML code for linking to this page:

Follow Navioo On Twitter

C# Examples

 Navioo File Directory Stream
» StreamWriter