Console application not closing

一个人想着一个人 提交于 2019-12-03 05:03:01

try this code:

Environment.Exit(0);

Are you putting you .exe file in Arguments property of ProcessStartInfo ? If you must do that, I believe that you're using CMD in FileName property, so you must use /K before your .exe name. Or just put in FileName the .exe path. You can clarify a lot if you put the code that calls your application.

tones

Try calling Application.Exit

This works in windowed applications, and may force the console window to close.

Try this:

Tools > Options > Debugging > Automatically Close the Console When Debugging Stops

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!