# WinForm关闭窗体确认
private void Lba_IE_Form_FormClosing(object sender, FormClosingEventArgs e) { if (MessageBox.Show("确实要退出服务程序吗?", "退出程序", MessageBoxButtons.OKCancel, MessageBoxIcon.Question) == DialogResult.OK) { Dispose(); Application.Exit(); } else { e.Cancel = true; } }