Your code looks like this (from your comment in the question - next time edit the question and insert the code so it's more readable and we don't have to repost it):
StreamWriter writeFile = new StreamWriter(
new IsolatedStorageFileStream(
txtBlkDirName.Text + "\\" + strFilenm,
FileMode.OpenOrCreate,
isf));
writeFile.WriteLine(txtPreSetMsg.Text); writeFile.Close();
Note that the mode you use is OpenOrCreate
, which is going to open the existing file and put your stream pointer at the start. If you immediately start writing, it's going to overwrite anything in the file.
Your options for appending would be:
- Use
FileMode.Append
instead so the pointer is already at the end of the stream after opening
- Keep what you have but before writing, call
Seek(0, SeekOrigin.End)
to move the pointer to the end of the file manually.