private void btnWaitForFiles_Click(object sender, EventArgs e) { if (btnWaitForFiles.Text == "Wait For Files") { try { Listen.Start(int.Parse(txtPort.Text)); btnWaitForFiles.Text = "Cancel Waiting"; } catch (Exception ex) { MessageBox.Show(ex.Message); } } else { Listen.Stop(); btnWaitForFiles.Text = "Wait For Files"; StatusStopped(); } }
private void FrmMain_FormClosing(object sender, FormClosingEventArgs e) { Listen.Stop(); Sender.Close(); }