Command Line Arguments in C#

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace CommandLine
{
    class Program
    {
        static void Main(string[] args)
        {
            Console.WriteLine("Hello "+args[0]);
            Console.ReadKey();
        }
    }
}

another

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace CommandLine
{
    class Program
    {
        static void Main(string[] jobs)
        {
            Console.WriteLine("Hello "+jobs[0]);
            Console.ReadKey();
        }
    }
}

it will give error:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace CommandLine
{
    class Program
    {
        static void Main(int[] jobs)
        {
            Console.WriteLine("Hello "+jobs[0]);
            Console.ReadKey();
        }
    }
}

It would be a great help, if you support by sharing :)
Author: zakilive

Leave a Reply

Your email address will not be published.