不运行程序 [英] does not run a program

查看:84
本文介绍了不运行程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我运行控制台应用程序时,它立即退出?

when i run console application program it exit immediatly ?

推荐答案

一种解决方案是在没有调试的情况下运行它。然后在程序完成时控制台窗口保持打开状态。

One solution is to run it without debugging. Then the console window remains open when the program is finished.

另一个选项是添加一行代码以暂停"Main"结尾处的执行。例如:

Another option is to add a line of code to pause execution at the end of "Main". For example:

Console.WriteLine("按ENTER退出。");

Console.WriteLine("Press ENTER to exit.");

Console.ReadLine();

Console.ReadLine();


这篇关于不运行程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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