private void Upload() { if (RecList.RecordCount > 0) { RecordFileWriter writer = new RecordFileWriter(@".\AutomaattiIn.py", RecList); writer.WriteToFile(); } else { MessageBox.Show("No records found!", "Error"); } TelnetHandler telnet = new TelnetHandler(settings); toolStatus.Text = "Connecting..."; this.Refresh(); telnet.UploadConfig(toolStatus, toolProgress); this.Refresh(); MessageBox.Show("Configuration updated"); }