How to read command line arguments in c# ?

Below c#/csharp code shows how to read command line arguments and print it on console.

using System;

namespace kodehelp.csharp.basic
{
    public class CmdArgument
    {
        public static void Main(string[] args)
        {
            Console.WriteLine("Argument size: " + args.Length);
            for (int i = 0; i < args.Length; i++)
            {
                Console.WriteLine("Argument[" + i + "] : " + args[i]);
            }
        }
    }
}

Please Post Your Comments & Reviews

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

This site uses Akismet to reduce spam. Learn how your comment data is processed.