Writes text a new text file.
Example
Writes lines to text file C#
string path = Path.GetTempFileName();
FileInfo fi = new FileInfo(path);
using (StreamWriter sw = fi.CreateText())
{
sw.WriteLine("Line1");
sw.WriteLine("Line2");
sw.WriteLine("Line3");
sw.WriteLine("Line4");
}