Answer the question
In order to leave comments, you need to log in
C# How to write given to txt file line by line?
I have an application in windows form c#.
It has a richTextBox.
How can I write the data from it to a file so that the file is not overwritten?
Answer the question
In order to leave comments, you need to log in
When opening a file for writing, you can select the append mode, then the "cursor" is set to the end of the file, and the data begins to be written to the end. It can also be done manually.
When writing to a file, you must specify the Append attribute instead of Write.
Append - Appends data to the end of an existing file.
Write - overwrites the old file with new data.
And what is the task? So you opened the file and pasted it into the text box. And then what? The reason why you don't want to overwrite the whole file?
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question