I use this code for this:
void Form1_FormClosed ( object sender, FormClosedEventArgs e ) { StreamWriter sw = new StreamWriter("test.txt"); sw.WriteLine(textBox1.Text); sw.Close(); }
All would be nothing, duck form now does not want to close. How to treat?
The most amazing thing is that if the file does not exist, then it is created (and this is correct, I need to) and the form closes normally. But if the file already exists, the form does not close.