0
我必须运行一些可执行文件,如何将输出保存到文本文件?有没有办法将shell脚本的输出保存到文本文件中?
我必须运行一些可执行文件,如何将输出保存到文本文件?有没有办法将shell脚本的输出保存到文本文件中?
在命令行,你可以这样做:
mycommand.exe > logfile.txt
对于样品读取使用ProcessStartInfo.RedirectStandardOutput和过程的输出Process.BeginOutputReadLine/OutputDataReceived看这里:Redirect standardoutput for Microsoft hotfix