Wednesday, March 25, 2009

how to: Windows Form GUI application take command arguments

It is not unusual to start an GUI application with some parameters passed in through command line. We are familiar with how it the work when create a console project, but the default GUI project won’t take any parameters.

To achieve this task, you can simply edit the Program.cs:

static void Main() ==> static void Main(string[] args)

Now you can use args. This easy? Yep.

No comments: