private static string InvokeCmd(string cmdArgs)
        {
            string Tstr = "";
            Process p = new Process();
            p.StartInfo.FileName = "cmd.exe";
            p.StartInfo.UseShellExecute = false;
            p.StartInfo.RedirectStandardInput = true;
            p.StartInfo.RedirectStandardOutput = true;
            p.StartInfo.RedirectStandardError = true;
            p.StartInfo.CreateNoWindow = true;
            p.Start();

            p.StandardInput.WriteLine(cmdArgs);
            p.StandardInput.WriteLine("exit");
            Tstr = p.StandardOutput.ReadToEnd();
            p.Close();
            return Tstr;
        }

  

相关文章:

  • 2022-03-05
  • 2021-12-12
  • 2022-02-07
  • 2022-01-12
  • 2022-12-23
  • 2022-12-23
  • 2022-02-17
  • 2022-12-23
猜你喜欢
  • 2021-12-13
  • 2022-12-23
  • 2022-01-15
  • 2022-12-23
  • 2021-10-31
  • 2021-07-16
  • 2022-01-04
相关资源
相似解决方案