using System.Diagnostics;


Process por = new Process();
            por.StartInfo.FileName = "cmd.exe";
            por.StartInfo.UseShellExecute = false;
            por.StartInfo.RedirectStandardInput = true;
            por.StartInfo.RedirectStandardOutput = true;
            por.StartInfo.RedirectStandardError = true;
            por.StartInfo.CreateNoWindow = true;        
            por.Start();
            por.StandardInput.WriteLine("shutdown /h");
            por.StandardInput.WriteLine("Exit");
            por.StandardOutput.ReadToEnd();

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-03-09
  • 2022-12-23
  • 2021-12-12
  • 2021-10-19
猜你喜欢
  • 2021-10-03
  • 2022-03-01
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案