当我开发一个C#控制台应用程序(这将在服务器上运行),我运行它使用Visual Studio,我得到一个preSS任意键继续的程序结束前的消息。
When I develop a C# console application (which will run on a server) and I run it using Visual Studio, I get a "Press any key to continue" message before the program terminates.
然而,当我编译手动使用CSC非常相同的C#code文件,我的程序不显示该消息并完成它的逻辑后立即终止。
However, when I compile the very same C# code file manually using CSC, my program doesn't show that message and it terminates immediately after finishing its logic.
有谁知道如何编译code时,不使用VS,并在不改变C#code任何添加的ReadLine()我可以做出同样的功能?
Does anyone know how I can make the same feature when compiling the code without using VS and WITHOUT changing the C# code any adding a ReadLine()?
更新:使用时,我学过C#出现同样的消息,我用TextPad与CSC,并用该消息出现,不添加任何写(线)/读取(线)的召唤
您可以编写一个运行的exe文件,为您和提示用户preSS的关键批处理脚本。
You could write a batch script that runs the exe for you and prompts the user to press a key.
批处理脚本会是这个样子:
The batch script would look something like this:
echo off
YourApp.exe
pause
上一篇:将光标定位在Word文档的开始/结束光标、结束、文档、Word
下一篇:.NET属性:为什么GetCustomAttributes()使每一次新的属性实例?属性、实例、NET、GetCustomAttributes