M
Mark
Hi all,
Is there a "standard" way to structure a small windows form such that it can
run non-interactively with an appropriate command line switch?
E.g, if I run the form normally I get the form's UI, but if I run it with /q
(or whatever), it runs non-interactively (perhaps logging to the event log).
I did try parsing the command line in Main(), but of course Main is static
and it's not possible therefore to use some field or method elsewhere in the
form based on what happens in Main(). I also tried parsing the command line
in the form's constructor but I noticed that once the code has got this far,
the form appears even if I skip InitializeComponent().
I guess that there's a standard way to do this?
TIA
Mark
Is there a "standard" way to structure a small windows form such that it can
run non-interactively with an appropriate command line switch?
E.g, if I run the form normally I get the form's UI, but if I run it with /q
(or whatever), it runs non-interactively (perhaps logging to the event log).
I did try parsing the command line in Main(), but of course Main is static
and it's not possible therefore to use some field or method elsewhere in the
form based on what happens in Main(). I also tried parsing the command line
in the form's constructor but I noticed that once the code has got this far,
the form appears even if I skip InitializeComponent().
I guess that there's a standard way to do this?
TIA
Mark