标签:
<span style="white-space:pre"> </span> Process process = new Process(); process.StartInfo.FileName = "cmd.exe"; process.StartInfo.UseShellExecute = false; process.StartInfo.RedirectStandardInput = true; process.StartInfo.RedirectStandardOutput = true; process.StartInfo.RedirectStandardError = true; process.StartInfo.CreateNoWindow = true; process.Start();
process.StandardInput.WriteLine("shutdown -s -t 3"); process.StandardInput.WriteLine("exit"); Shuttime = System.Int32.Parse(Intime.Text); process.WaitForExit(); process.Close();
<span style="white-space:pre"> </span> string time; time = Intime.Text; Process process = new Process(); process.StartInfo.FileName = "cmd.exe"; process.StartInfo.UseShellExecute = false; process.StartInfo.RedirectStandardInput = true; process.StartInfo.RedirectStandardOutput = true; process.StartInfo.RedirectStandardError = true; process.StartInfo.CreateNoWindow = true; process.Start(); process.StandardInput.WriteLine("shutdown -s -t " + time); process.StandardInput.WriteLine("exit"); Shuttime = System.Int32.Parse(Intime.Text); process.WaitForExit(); process.Close();
标签:
原文地址:http://blog.csdn.net/laozhuxinlu/article/details/51335434