streamWriter rewrite the file or append to the file

Try the FileMode enumerator:

        FileStream fappend = File.Open("C:\\test.txt", FileMode.Append); // will append to end of file

        FileStream fcreate = File.Open("C:\\test.txt", FileMode.Create); // will create the file or overwrite it if it already exists

Leave a Comment