How would I replace the text in a file with c#. I can write to the file, but if I write to the file a second time it appends the new data to the old rather than replace it. Here is a copy of what I'm using
fsFile = new FileStream("test.txt",FileMode.Open);
StreamWriter swOut = new StreamWriter(fsFile);
swOut.Write(strOut);
swOut.Close();
The output looks like this:
TestTestTestTestTest
And I want it to look like this:
Test
Any suggestions?