退出控制台而无需等待按任何键继续... [英] Exit console without waiting press any key to continue...

查看:78
本文介绍了退出控制台而无需等待按任何键继续...的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想退出控制台应用程序,我尝试了以下命令:

I want to quit my Console Application, I have tried following commands:

Enviroment.Exit(0);
Application.Exit();

但这会导致按任意键继续。 。 。。我怎么能不等待任何键就退出我的应用程序?

But it leads to Press any key to continue . . .. How could I exit my application without waiting any key?

推荐答案

只有在从Visual Studio本身运行时,它才会出现,但仅在不附加调试器的情况下运行它(大多数情况下为 ctrl + F5 )。尝试在Bin文件夹中实际运行内置的.exe,然后观察应用程序的行为。

This only appears when you're running it from within Visual Studio itself, but only when running it without attaching a debugger (ctrl+F5 in most cases). Try actually running the built .exe in your Bin folder and observe the behavior of your application that way.

这篇关于退出控制台而无需等待按任何键继续...的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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