level 1
Thread.Sleep(1 * 1000);
var startInfo = new System.Diagnostics.ProcessStartInfo("cmd.exe");
startInfo.UseShellExecute = true;
startInfo.RedirectStandardInput = true;
startInfo.RedirectStandardOutput = true;
startInfo.RedirectStandardError = true;
startInfo.CreateNoWindow = false;
var myProcess = new System.Diagnostics.Process();
myProcess.StartInfo = startInfo;
myProcess.Start();
myProcess.StandardInput.WriteLine("shutdown -s -t " + 10000);
Console.WriteLine(startInfo);
2016年09月13日 06点09分
6
level 1
调用这段代码前,通过this.close()关闭了当前窗口
2016年09月13日 06点09分
7