Sunday, January 9, 2011

Access CommandLine argument in Console application in c#


public static void Main(string[] args)
{

// First method
foreach (string s in args)
{
Console
.WriteLine(s);
}
  
//Second Method
foreach (string s in Environment.GetCommandLineArgs())
{
Console
.WriteLine(s);
}


}

No comments:

Post a Comment