Show/Hide the console window of a C# console application

前端 未结 8 2271
走了就别回头了
走了就别回头了 2020-11-22 10:13

I googled around for information on how to hide one’s own console window. Amazingly, the only solutions I could find were hacky solutions that involved FindWindow()

8条回答
  •  北恋
    北恋 (楼主)
    2020-11-22 10:53

    "Just to hide" you can:

    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.

提交回复
热议问题