我的代码只是在文件中添加了textBox3中的一行,但是需要写,也就是没有之前的记录。
using namespace System::IO;
private: System::Void button4_Click(System::Object^ sender, System::EventArgs^ e) {
StreamWriter^ f = gcnew StreamWriter("Result.txt", true);
f->Write(textBox3->Text);
f->Write("\n");
f->Close();
MessageBox::Show(this, "Запись в файл выполнена", "Сообщение", MessageBoxButtons::OK, MessageBoxIcon::Information);
}
1 个回答