111,126
社区成员
发帖
与我相关
我的任务
分享
private void button1_Click(object sender, EventArgs e)
{
if (DateTime.Now.Hour == int.Parse(comboBox1.Text) && DateTime.Now.Minute == numericUpDown2.Value)
{
msg=MessageBox.Show("您现在就要关机吗?建议先取消,设置具体时间关机!", "温馨提示!", MessageBoxButtons.YesNo, MessageBoxIcon.Exclamation);
if ( msg== DialogResult.Yes)
{
System.Diagnostics.Process.Start("cmd.exe", "shutdown -f -s -t 1"); //强制一秒倒计时关机!
}
else
return;
}