One of the constructors of the StearWriter class has a boolean called "Append". set it to true, this should append the content to the end of the stream instead of overwriting it. basically, all you have to do is replace this code line
StreamWriter^ outFile = gcnew StreamWriter("file.txt");
with this one:
StreamWriter^ outFile = gcnew StreamWriter("file.txt", true);