ale*_*exn 19
好吧,你可以启动一个新的cmd.exe进程并使用stdio和stdout来发送和接收数据.
ProcessStartInfo psi = new ProcessStartInfo("cmd.exe")
{
RedirectStandardError = true,
RedirectStandardInput = true,
RedirectStandardOutput = true,
UseShellExecute = false
};
Process p = Process.Start(psi);
StreamWriter sw = p.StandardInput;
StreamReader sr = p.StandardOutput;
sw.WriteLine("Hello world!");
sr.Close();
Run Code Online (Sandbox Code Playgroud)
有关MSDN的更多信息.