Behavior in WinForm/Console Hybrid Application

后端 未结 4 2030
走了就别回头了
走了就别回头了 2021-01-20 14:28

I have a WinForm project that I want to be usable as a console app if certain arguments are passed into it. Using some tips I read from here, I used the following code to m

4条回答
  •  深忆病人
    2021-01-20 14:42

    The above will work, but it won't allow you to write to the console which is maddening if you're trying to debug exceptions. To write to the console from a Win Forms app, you need to apply the code described here: http://www.codeissue.com/issues/i24e1ef8e5a93b4/run-windows-form-application-as-console-app-c.

提交回复
热议问题