如何将控制台屏幕记录到文本文件? [英] How to Log Console Screen into a Text File?
本文介绍了如何将控制台屏幕记录到文本文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
可能重复:
将控制台输出镜像到文件
我在一个控制台应用程序在C#,我想登录到一个文本文件每个文本出现在屏幕上。如何做到这一点?
I've a console application in C# and I want to Log into a text file every text appears on the screen. How to do that ?
不幸的是,这个线程是关闭的,尽管我对将控制台输出镜像到文件。接受的帖子作为答案的线程是不正确的。那么为什么不能再问这个问题呢?我使用控制台交互式,并想要一个文本文件中控制台上的所有文本的副本。 SOS
Unfortunately this thread is closed despite of my comment about the Mirroring console output to a file. The accepted post as answer by that thread IS NOT CORRECT. So why cannot ask the question again? I'm using console interactively and want a copy of all the text on console in a text file. SOS
推荐答案
C:\>yourconsoleapp.exe > yourtextfile.txt
编辑:假设您的控制台应用程式不需要使用者输入。
edit: This assumes your console app requires no user input.
这篇关于如何将控制台屏幕记录到文本文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文