How can I hide a console window?

前端 未结 4 472
小蘑菇
小蘑菇 2020-12-09 17:35

Question: I have a console program that shouldn\'t be seen. (It resets IIS and deletes temp files.)

Right now I can manage to hide the window right after start like

4条回答
  •  醉梦人生
    2020-12-09 18:13

    If you don't need the console (e.g. for Console.WriteLine) then change the applications build options to be a Windows application.

    This changes a flag in the .exe header so Windows doesn't allocate a console session when the application starts.

提交回复
热议问题