本文介绍了单击MessageBox后,关闭C#控制台应用程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我仍在学习C#提供的所有很酷的技巧.我有一个消息框警报,计时器到期后会弹出.我想知道在用户单击消息框上的确定"按钮之后,是否有可能让控制台应用程序自行终止.在任何情况下,控制台应用程序都会自动最小化到任务栏.
谢谢.
解决方案尝试一下:
// Terminates this process and gives the underlying operating system the specified exit code. Environment.Exit()MSDN:Environment.Exit方法
I'm still learning all the cool tricks C# has to offer. I have a messagebox alert that pops up after a timer expires. I'm wondering if it is at all possible to have the console application terminate on its own after the user click the "OK" button on the messagebox. The console app is automatically minimized to the taskbar if that of any circumstance.
Thanks in advance.
解决方案Give this a go:
// Terminates this process and gives the underlying operating system the specified exit code. Environment.Exit()MSDN: Environment.Exit Method
更多推荐
单击MessageBox后,关闭C#控制台应用程序
发布评论