Ho creato questa funzione per salvare i dati delle textbox prima di uscire ma non viene eseguita. Perche???
codice:
private void Form1_Closing(Object sender, System.ComponentModel.CancelEventArgs e)
{
StreamWriter save = new StreamWriter("Parametri.txt");
save.WriteLine(textBox3.Text);
save.WriteLine(textBox4.Text);
save.WriteLine(textBox5.Text);
save.Close();
}
Grazie!!
Aggiungo che anche all'avvio se faccio:
codice:
public Form1()
{
InitializeComponent();
try
{
StreamReader save = new StreamReader("Parametri.txt");
textBox3.Text = save.ReadLine();
textBox4.Text = save.ReadLine();
textBox5.Text = save.ReadLine();
N_test = Convert.ToInt32(textBox3.Text);
TimeOut = Convert.ToInt32(textBox4.Text);
TempDown = Convert.ToInt32(textBox5.Text);
}
catch
{
N_test = 50;
TempDown = 2000;
TimeOut = 30000;
}
}
non succede niente. Grazie