0

I am writing 1 line to a file and close the file. Then after a few seconds the file will be open and written to again but then when using the code the string is overwritten.
What I want to do is to continue write on next line.

I am not sure if the .NewLine() is used for this, The line with NewLine() doesn´t compile when I write it like this.

writingThis.WriteLine(TextBox2.Text.Trim());
//writingThis.NewLine(); ??
writingThis.Close();
1
Contributor
1
Reply
3
Views
7 Years
Discussion Span
Last Post by Lukezzz
0

I just found out I forgot to append like this:

FileStream gd2 = new System.IO.FileStream("Path", System.IO.FileMode.Append, System.IO.FileAccess.Write, System.IO.FileShare.ReadWrite);
This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.