Hide Console Window in C# Console Application

余生颓废 提交于 2019-11-28 15:46:06

Change the output type from Console Application to Windows Application. This can be done under Project -> Properties -> Application in Visual Studio:

Change your application type to a windows application. Your code will still run, but it will have no console window, nor standard windows window unless you create one.

khaja kamal

Instead of Console.Readline/key you can use new ManualResetEvent(false).WaitOne() at last. This works well for me.

Maybe you want to try creating a Windows Service application. It will be running in the background, without any UI.

Change the output type from Console Application to Windows Application,

And Instead of Console.Readline/key you can use new ManualResetEvent(false).WaitOne() at the end to keep the app running.

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