private void button_rec_Click(object sender, EventArgs e) { if (MyFile == null && sensor != null) { this.textBox_sensorStatus.Text = "Initialize"; this.textBox_sensorStatus.BackColor = Color.Yellow; DateTime thisDay = DateTime.UtcNow; string txtFileName = thisDay.ToString("dd.MM.yyyy_HH.mm"); MyFile = new MyWrite(txtFileName); MyFile.setTextFeld(textFields1); } }
private void button_recStop_Click(object sender, EventArgs e) { if (MyFile != null) { MyFile.MyCloseFile(); this.textBox_sensorStatus.Text = "Recording captured"; this.textBox_sensorStatus.BackColor = Color.White; MyFile = null; } }