In this chapter you will learn:
- What is TextWriter Class?
- How to use it in C# Programming?
TextWriter class represents a writer that can write sequential series of characters. You can use this class to write text in a file. It is an abstract base class of
StringWriter, which write characters to streams and string respectively.
static void Main(string args)
using (TextWriter writer = File.CreateText(file))
writer.WriteLine("File Handling Tutorial");
Console.WriteLine("Entry stored successfull!");
In this chapter you learned how to use
TextWriter class in File Handling. Next, you will learn how to read file using TextReader class.