How do I detect if I'm running in the console

后端 未结 4 1595
误落风尘
误落风尘 2020-12-17 14:28

Is there a simple way to have a code library automatically detect if it\'s being called from a console application or a windows application? I\'d like my library not to rep

4条回答
  •  粉色の甜心
    2020-12-17 15:13

    Just discovered that "Console.Title" will be a blank string in a windows application and it will be automatically set in a console application.

    Still a hack though.

提交回复
热议问题