File Stream C#

using System;
using System.IO;
using System.Text;
class StrWriter
{
    static void Main()
    {
        StringWriter strWriter  = new StringWriter();
        strWriter.Write("file path characters are: ");
        strWriter.Write(
            Path.InvalidPathChars, 0, Path.InvalidPathChars.Length);
        strWriter.Write('.');
        strWriter.GetStringBuilder().Insert(0, "Invalid ");
        Console.WriteLine("The following string is {0} encoded.\n{1}", 
            strWriter.Encoding.EncodingName, strWriter.ToString());
    }
}