What I want to do is to read/write text file as follows:
- Display the .txt file content in a control, such as RichTextBox
- Save the text in RichTextBox to a specified .txt file
The txt file size won’t be large. There are several methods that could do the job, but I am not sure which one is better
- TextReader/TextWriter
- File class, by using File.ReadAll, File.WriteAll
If you are using RichTextBox, the control itself support, reading and writing files. –
RichTextBox Class