Click to See Complete Forum and Search --> : System::IO::File::WriteAllText command


Programmer127
January 7th, 2007, 08:13 PM
The following code writes all of the text in richtextbox1->text to the file located at the path in textbox1->text. But, the text file inserts a little square in the place of each new line. How can I fix this so I can write multiple lines to a text file? Thanks in advance!
------------------------------------------------------------------------------------------------
using namespace System;
IO::File::WriteAllText(this->textBox1->Text, this->richTextBox1->Text);
------------------------------------------------------------------------------------------------

cilu
January 8th, 2007, 02:05 AM
Did you try to overload that takes a third parameter, an encoding?

IO::File::WriteAllText(this->textBox1->Text, this->richTextBox1->Text, Encoding::ASCIIEncoding);

cilu
January 8th, 2007, 02:05 AM
[ redirected ]