求大神指点迷津,为什么这段代码能运行,缺不起作用

private void closewindows(object se)
{
Thread.Sleep((int)se* 1000);
var startInfo = new System.Diagnostics.ProcessStartInfo("cmd.exe");
startInfo.UseShellExecute = false;
startInfo.RedirectStandardInput = true;
startInfo.RedirectStandardOutput = true;
startInfo.RedirectStandardError = true;
startInfo.CreateNoWindow = true;
var myProcess = new System.Diagnostics.Process();
myProcess.StartInfo = startInfomyProcess.Start();
myProcess.StandardInput.WriteLine("shutdown -s -t " + 1);
Console.WriteLine("end");
}
引用方法前,this.close()关闭了窗口,代码可以运行,但是没有起到作用,打个断点,的确也进入断点了,手动操作下一步下一步的操作,代码起作用,设置了windows关机时间,但是不在断点模式下运行,代码就没用,是为什么啊,好困扰

http://www.jb51.net/article/64018.htm