Write Text to Stream - CSharp File IO

CSharp examples for File IO:Text File

Description

Write Text to Stream

Demo Code


using System.Threading.Tasks;
using System.Text;
using System.Linq;
using System.IO;/*ww  w. j  a  v  a2  s  .  co m*/
using System.Collections.Generic;
using System;

public class Main{
        public static void WriteText(this Stream stream, string text)
    {
      var writer = new StreamWriter(stream);
      writer.Write(text);
      writer.Flush();
    }
}

Related Tutorials