其在Visual Studio控制台应用程序的输出,而不是控制台 [英] Having the output of a console application in Visual Studio instead of the console

查看:911
本文介绍了其在Visual Studio控制台应用程序的输出,而不是控制台的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在做与Eclipse Java中的控制台应用程序,我看到正在把在IDE本身就是一个文本框的输出,而不是有一个控制台在Visual Studio中弹出等。这个就派上用场了,因为程序已经结束,也,但我还是能利用好这是写于它,因为它不会被删除,直到我再次运行它的文字。是否有可能实现这样的与Visual Studio什么?我知道,而不是做

When doing a console application in Java with Eclipse, I see the output being put in a text box in the IDE itself, instead of having a console popping up like in Visual Studio. This comes in handy, as even after the program has exited, I can still make good use of the text that was written in it, as it doesn't get erased until I run it again. Is it possible to achieve anything like that with Visual Studio? I know that instead of doing

System.Console.WriteLine(str);

我可以做

System.Diagnostics.Debug.WriteLine(str);

但它是不完全一样的东西,因为你在输出窗口得到了很多垃圾,因为所有加载的符号和等。

but it is not quite the same thing, as you get a lot of "junk" in the Output window, as all the loaded symbols and such.

更妙的是,是否有可能拥有一切在IDE本身完成,当你运行你的应用程序,而不必运行控制台?

Even better, is it possible to have everything done in the IDE itself, when you run your application, instead of having the console running?

推荐答案

在Visual Studio的选项对话框 - >调试 - >勾选重定向所有输出窗口文本到立即窗口

In the Visual Studio Options Dialog -> Debugging -> Check the "Redirect All Output Window Text to the Immediate Window".

这篇关于其在Visual Studio控制台应用程序的输出,而不是控制台的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆