Print command Line argument using C#

Sourav.Kayal
Posted by Sourav.Kayal under C# category on | Points: 40 | Views : 1080
using System;
using System.Text;
using System.Data.SqlClient;
namespace Test1
{
class Program
{
static void Main(string[] args)
{
Console.WriteLine("Main Begins");

if (args.Length == 0)
{
Console.WriteLine("Argument Count = 0");
}
else
{
for (int i = 0; i < args.Length; i++)
{
Console.WriteLine("Argument [{0}] is [{1}]", i, args[i]);
}
}

Console.WriteLine("Main Function End");

Console.ReadLine();
}
}
}

Comments or Responses

Login to post response