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.
问题是,我真的不希望控制台窗口出现……但解决方案应该是可行的。我的观点是,我想让应用程序在后台运行,不需要任何窗口出现。
4 个解决方案
#1
155
Change the output type from Console Application to Windows Application. This can be done under Project -> Properties -> Application in Visual Studio:
将输出类型从控制台应用程序更改为Windows应用程序。这可以在Visual Studio中的项目> Properties ->应用程序下完成:
#2
20
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.
将应用程序类型更改为windows应用程序。您的代码仍然会运行,但是它没有控制台窗口,也没有标准窗口窗口,除非您创建一个。
#3
7
Instead of Console.Readline/key
you can use new ManualResetEvent(false).WaitOne()
at last. This works well for me.
而不是控制台。你终于可以使用新的ManualResetEvent(false). waitone()了。这对我来说很有效。
#4
2
Maybe you want to try creating a Windows Service application. It will be running in the background, without any UI.
也许您想尝试创建一个Windows服务应用程序。它将在后台运行,没有任何UI。
#1
155
Change the output type from Console Application to Windows Application. This can be done under Project -> Properties -> Application in Visual Studio:
将输出类型从控制台应用程序更改为Windows应用程序。这可以在Visual Studio中的项目> Properties ->应用程序下完成:
#2
20
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.
将应用程序类型更改为windows应用程序。您的代码仍然会运行,但是它没有控制台窗口,也没有标准窗口窗口,除非您创建一个。
#3
7
Instead of Console.Readline/key
you can use new ManualResetEvent(false).WaitOne()
at last. This works well for me.
而不是控制台。你终于可以使用新的ManualResetEvent(false). waitone()了。这对我来说很有效。
#4
2
Maybe you want to try creating a Windows Service application. It will be running in the background, without any UI.
也许您想尝试创建一个Windows服务应用程序。它将在后台运行,没有任何UI。