Winform弹出确认窗口

这是系统重要功能操作的典型需求,在Winform中,重要操作之前弹出对话框让用户确认:

DialogResult result = MessageBox.Show("确定退出系统吗?", "退出系统", MessageBoxButtons.YesNo, MessageBoxIcon.Question);
if (result == DialogResult.Yes)
{
    //确认后的具体操作
}
else { return; }
—— 完 ——