How to

get command line arguments as array

Published: 9. October 2011 | Updated: 26. October 2011
License: Microsoft Public License (MS-PL)
Categories: Consoles
Tags: C# Console
Was this snippet helpful for you? YESYES / NONO
string[] arguments = Environment.GetCommandLineArgs();

or...

static void Main(string[] args)
{
    foreach (string argument in args)
    {
        Console.WriteLine(argument);
    }


}
Send us feedback about this snippet »



Related Snippets: