C# 是否仍然可以将shell脚本的输出保存到文本文件中?

C# 是否仍然可以将shell脚本的输出保存到文本文件中?,c#,C#,我必须运行一些可执行文件,如何将输出保存到文本文件?对于使用ProcessStartInfo.RedirectStandardOutput和process.BeginOutputReadLine/OutputDataReceived读取进程输出的示例,请看这里:对于使用ProcessStartInfo.RedirectStandardOutput和Process.BeginOutputReadLine/OutputDataReceived查看此处:在命令行上,您可以执行以下操作: mycomma

我必须运行一些可执行文件,如何将输出保存到文本文件?

对于使用ProcessStartInfo.RedirectStandardOutput和process.BeginOutputReadLine/OutputDataReceived读取进程输出的示例,请看这里:

对于使用ProcessStartInfo.RedirectStandardOutput和Process.BeginOutputReadLine/OutputDataReceived查看此处:

在命令行上,您可以执行以下操作:

mycommand.exe > logfile.txt

在命令行上,可以执行以下操作:

mycommand.exe > logfile.txt