Hide Console Window in C# Console Application

泪湿孤枕 提交于 2019-11-27 09:22:37

问题


The thing is, i really dont want the console window to show up...but the solution should be running. My point here is, I want to keep the application running in the background, without any window coming up.


回答1:


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




回答2:


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.




回答3:


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




回答4:


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




回答5:


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.



来源:https://stackoverflow.com/questions/3853629/hide-console-window-in-c-sharp-console-application

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