CSharp examples for File IO:Text File
create a new text file and write a line to it
using static System.Console; using static System.IO.Directory; using static System.IO.Path; using static System.Environment; using System.IO;/*from w w w . jav a2 s . c om*/ class Program { static void Main(string[] args) { StreamWriter textWriter = File.CreateText("z.txt"); textWriter.WriteLine("Hello, C#!"); textWriter.Close(); // close file and release resources } }