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
Maybe I've been doing it wrong but I've always done hybrids like this:
[STAThread]
public static int Main(string[] args)
{
if (args.Length > 0)
{
// run console code here
}
else
{
// start up the win form app
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Application.Run(new MainForm());
}
return 0;
}