Hello,

I am making a checkList program in c# and it's almost complete.

I used the "StreamWriter" and "StreamReader" class to read and write the texts. But after closing it once when i reopen the application and add a new task in the CheckList the prrvious one gets erased from the file.

Is there a way to write a line of text in a file without erasing the prevoius texts ?

Recommended Answers

All 2 Replies

If you look at the available constructors for StreamWriter you will see that one of them can be used to indicate you want to append to the file.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.