Hide Console Window in C# Console Application

前端 未结 5 1179
面向向阳花
面向向阳花 2020-12-07 10:48

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 backgro

相关标签:
5条回答
  • 2020-12-07 11:12

    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.

    0 讨论(0)
  • 2020-12-07 11:21

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

    alt text

    0 讨论(0)
  • 2020-12-07 11:22

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

    0 讨论(0)
  • 2020-12-07 11:30

    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.

    0 讨论(0)
  • 2020-12-07 11:32

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

    0 讨论(0)
提交回复
热议问题