获取命令行输出内容的方式有传统和异步两种方式. 传统方式: public static void RunExe(string exePath, string arguments, out string output, out string error) { using (Process process = new System.Diagnostics.Process()) { process.StartInfo.FileName = exePath; process.StartInfo.Argu
bat echo 输出内容为不同的颜色 先看代码: @echo off SETLOCAL EnableDelayedExpansion for /F "tokens=1,2 delims=#" %%a in ('"prompt #$H#$E# & echo on & for %%b in (1) do rem"') do ( set "DEL=%%a" ) rem echo say the name of the colors,