How to write data to a text file without overwriting the current data
Change your constructor to pass true as the second argument.
TextWriter tsw = new StreamWriter(@"C:\Hello.txt", true);
Pass true
as the append
parameter of the constructor:
TextWriter tsw = new StreamWriter(@"C:\Hello.txt", true);