How do I create a C# app that decides itself whether to show as a console or windowed app?

前端 未结 11 798
广开言路
广开言路 2020-11-28 21:10

Is there a way to launch a C# application with the following features?

  1. It determines by command-line parameters whether it is a windowed or console app
11条回答
  •  鱼传尺愫
    2020-11-28 21:28

    One way to do this is to write a Window app that doesn't show a window if the command line arguments indicate it shouldn't.

    You can always get the command line arguments and check them before showing the first window.

提交回复
热议问题