Get Command Line Parameters in Windows Forms App (C#)

By | 2008-07-30

To get command line parameters in a standard console app (C#):

static void Main(string[] args)
{
foreach (string arg in args)
{
...
}
}

To get command line parameters in a windows forms app (C#):

string[] args = Environment.GetCommandLineArgs();

foreach (string arg in args)
{
...
}

Leave a Reply

Your email address will not be published. Required fields are marked *