C#: Is it possible to have a single application behave as Console or Windows application depending on switches?

前端 未结 7 2277
无人及你
无人及你 2020-12-09 21:25

I have a simple application that I would like to sort of automate via switches. But when I do run it via switches I don\'t really want a user interface showing. I just want

7条回答
  •  庸人自扰
    2020-12-09 22:02

    Without implementing your own version of a console window the answer is no. When Windows loads you executable it decides whether or not to give you a console window based on data in the PE header. So you can make a windowed app not have a window but you can't make a windoed app have a console.

提交回复
热议问题