SyntaxFix
Write A Post
Hire A Developer
Questions
Replace this line:
StreamWriter sw = new StreamWriter("c:/file.txt");
with this code:
StreamWriter sw = File.AppendText("c:/file.txt");
and then write your line to the text file like this:
sw.WriteLine("text content");